Skip to content

Commit e33f94a

Browse files
committed
revert multiple class mapping
1 parent 169a978 commit e33f94a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

optimum/exporters/openvino/model_configs.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,14 @@ def init_model_configs():
132132
"transformers",
133133
"Qwen2VLForConditionalGeneration",
134134
)
135-
136-
TasksManager._TRANSFORMERS_TASKS_TO_MODEL_LOADERS["image-text-to-text"] = (
137-
(
138-
"AutoModelForImageTextToText",
139-
"AutoModelForCausalLM",
140-
)
141-
if is_transformers_version(">=", "4.46")
142-
else TasksManager._TRANSFORMERS_TASKS_TO_MODEL_LOADERS["text-generation"]
135+
TasksManager._CUSTOM_CLASSES[("pt", "qwen2-5-vl", "image-text-to-text")] = (
136+
"transformers",
137+
"AutoModelForImageTextToText",
143138
)
144139

140+
TasksManager._TRANSFORMERS_TASKS_TO_MODEL_LOADERS[
141+
"image-text-to-text"
142+
] = TasksManager._TRANSFORMERS_TASKS_TO_MODEL_LOADERS["text-generation"]
145143
if is_diffusers_available() and "fill" not in TasksManager._DIFFUSERS_TASKS_TO_MODEL_LOADERS:
146144
TasksManager._DIFFUSERS_TASKS_TO_MODEL_LOADERS["fill"] = "FluxFillPipeline"
147145
TasksManager._DIFFUSERS_TASKS_TO_MODEL_MAPPINGS["fill"] = {"flux": "FluxFillPipeline"}
@@ -2573,7 +2571,7 @@ def generate(self, input_name: str, framework: str = "pt", int_dtype: str = "int
25732571
return self.random_float_tensor([grid_h * grid_t * grid_w, dim], framework=framework, dtype=float_dtype)
25742572

25752573
if input_name == "window_index":
2576-
if self.spatial_merge_size:
2574+
if self.spatial_merge_size is None:
25772575
raise ValueError(
25782576
"`spatial_merge_size` parameter is not found in model config. Can not generate dummy input data for `window_index` input"
25792577
)

0 commit comments

Comments
 (0)