mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-30 00:00:26 +08:00
Fix Pixtral 12b compatibility
This commit is contained in:
parent
a4a9e4b59f
commit
c6111fae7d
@ -399,14 +399,21 @@ class TransformersManagedModel(ModelManageable, LanguageModel):
|
|||||||
if hasattr(self.processor, "to"):
|
if hasattr(self.processor, "to"):
|
||||||
self.processor.to(device=self.offload_device)
|
self.processor.to(device=self.offload_device)
|
||||||
assert "input_ids" in batch_feature
|
assert "input_ids" in batch_feature
|
||||||
batch_feature.to(device=self.load_device, dtype=self.model_dtype())
|
try:
|
||||||
|
batch_feature.to(device=self.load_device, dtype=self.model_dtype())
|
||||||
|
except TypeError:
|
||||||
|
# works around Pixtral processor bug
|
||||||
|
batch_feature.to(self.load_device)
|
||||||
|
batch_feature.to(self.model_dtype())
|
||||||
# noinspection PyTypeChecker
|
# noinspection PyTypeChecker
|
||||||
return {
|
batch_feature_dict = {
|
||||||
"image_sizes": image_sizes,
|
|
||||||
"images": batch_feature["pixel_values"],
|
|
||||||
"inputs": batch_feature["input_ids"],
|
"inputs": batch_feature["input_ids"],
|
||||||
**batch_feature
|
**batch_feature
|
||||||
}
|
}
|
||||||
|
if "pixel_values" in batch_feature:
|
||||||
|
batch_feature_dict["image_sizes"] = image_sizes
|
||||||
|
batch_feature_dict["images"] = batch_feature["pixel_values"]
|
||||||
|
return batch_feature_dict
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def repo_id(self) -> str:
|
def repo_id(self) -> str:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user