remove some unnecessary if conditions

Former-commit-id: 482d3e5ff3338385da664475fee88c7dc623c993
This commit is contained in:
Kingsley
2024-09-28 02:14:06 +08:00
parent 9390927875
commit e4c57f54f8
3 changed files with 43 additions and 17 deletions

View File

@@ -168,7 +168,7 @@ class HuggingfaceEngine(BaseEngine):
for key, value in mm_inputs.items():
value = value if isinstance(value, torch.Tensor) else torch.tensor(value)
gen_kwargs[key] = value.to(model.device)
return gen_kwargs, prompt_length
@staticmethod