This commit is contained in:
hiyouga
2024-12-30 05:55:15 +00:00
parent b55890291b
commit 6f5bb3b8e5
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)