Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a fallback to change torch_dtype if cuda isn't available. #32

Merged
merged 1 commit into from
May 10, 2024

Conversation

Lyaaaaaaaaaaaaaaa
Copy link
Member

config.py:

  • Added TORCH_DTYPE_SAFETY.

model.py:

  • Updated _load_model to force (if config.TORCH_DTYPE_SAFETY is True) torch_dtype to be set to float32 if cuda isn't available. Because otherwise, it will lead to an error during generation. See [BUG] "topk_cpu" not implemented for 'Half' #31

config.py:
- Added TORCH_DTYPE_SAFETY.

model.py:
- Updated _load_model to force (if config.TORCH_DTYPE_SAFETY is True)
torch_dtype to be set to float32 if cuda isn't available.
Because otherwise, it will lead to an error during generation.
See #31
@Lyaaaaaaaaaaaaaaa Lyaaaaaaaaaaaaaaa merged commit 6b76d8d into Develop May 10, 2024
@Lyaaaaaaaaaaaaaaa Lyaaaaaaaaaaaaaaa deleted the FixNotImplemented4HalfError branch May 10, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant