Former-commit-id: 8577f52b4152efe6cc7a8b5f6d37b4f9ba6684e7
This commit is contained in:
hiyouga
2024-12-30 05:55:15 +00:00
parent 5f473e2696
commit f8f05a883b
7 changed files with 26 additions and 11 deletions

View File

@@ -171,7 +171,7 @@ class HuggingfaceEngine(BaseEngine):
elif not isinstance(value, torch.Tensor):
value = torch.tensor(value)
if torch.is_floating_point(value):
if torch.is_floating_point(value): # cast data dtype for paligemma
value = value.to(model.dtype)
gen_kwargs[key] = value.to(model.device)