-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
fix
] Add dtype cast for modules other than Transformer (#2889)
* add dtype cast to other modules * check if kwargs are None * format * Cast the entire model to the dtype of the first parameter This should be a tad safer. The original fix failed for torch_dtype = "auto", "float16", "bfloat16", and would not be receptive to models automatically loaded in fp16 via a custom Module --------- Co-authored-by: Tom Aarsen <Cubiegamedev@gmail.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 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