-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fast cli): Import torch lazily in all places used by the CLI tha…
…t don't need a model These changes add a little complexity with the lazy and local imports, but they also greatly improve the CLI's response for --help, list, and where. Changes: * Move `import torch` into function bodies that need them * Use `importlib.metadata.version` to check the torch version rather than torch.__version__ * Switch from using torch.inference_mode as a decorator to using it as a context manager. * I also removed it from convert_hf_checkpoint_to_tune since that does not use torch at all * In build_utils, wrap the dtype values in lambdas so they're lazily fetched. #1347 Branch: FasterCli-1347 Signed-off-by: Gabe Goodhart <[email protected]>
- Loading branch information
1 parent
4a7dab8
commit 8ae1bc5
Showing
3 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters