mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 22:32:54 +08:00
fix bug
Former-commit-id: bb0afda8fbb7d3556c1742bccf0b33ee3bf0f0b6
This commit is contained in:
parent
49054329d0
commit
15786539d7
@ -166,7 +166,7 @@ class HuggingfaceEngine(BaseEngine):
|
|||||||
|
|
||||||
mm_inputs = template.mm_plugin.get_mm_inputs(**mm_input_dict, seqlens=[prompt_length], processor=processor)
|
mm_inputs = template.mm_plugin.get_mm_inputs(**mm_input_dict, seqlens=[prompt_length], processor=processor)
|
||||||
for key, value in mm_inputs.items():
|
for key, value in mm_inputs.items():
|
||||||
if isinstance(value, list) and all(isinstance(v, torch.Tensor for v in value)): # for pixtral inputs
|
if isinstance(value, list) and all(isinstance(v, torch.Tensor) for v in value): # for pixtral inputs
|
||||||
value = torch.stack(value) # assume they have same sizes
|
value = torch.stack(value) # assume they have same sizes
|
||||||
elif not isinstance(value, torch.Tensor):
|
elif not isinstance(value, torch.Tensor):
|
||||||
value = torch.tensor(value)
|
value = torch.tensor(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user