File tree 2 files changed +16
-2
lines changed
optimum/exporters/openvino
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,15 @@ def _set_runtime_options(
100
100
for model_name in models_and_export_configs .keys ():
101
101
_ , sub_export_config = models_and_export_configs [model_name ]
102
102
sub_export_config .runtime_options = {}
103
- if "diffusers" in library_name or "text-generation" in task :
103
+ if (
104
+ "diffusers" in library_name
105
+ or "text-generation" in task
106
+ or ("image-text-to-text" in task and model_name == "language_model" )
107
+ ):
104
108
sub_export_config .runtime_options ["ACTIVATIONS_SCALE_FACTOR" ] = "8.0"
105
- if not quantized_model and "text-generation" in task :
109
+ if not quantized_model and (
110
+ "text-generation" in task or ("image-text-to-text" in task and model_name == "language_model" )
111
+ ):
106
112
sub_export_config .runtime_options ["KV_CACHE_PRECISION" ] = "f16"
107
113
108
114
Original file line number Diff line number Diff line change @@ -134,6 +134,14 @@ def _openvino_export(
134
134
self .assertTrue (ov_model .model .has_rt_info (["runtime_options" , "ACTIVATIONS_SCALE_FACTOR" ]))
135
135
self .assertTrue (ov_model .model .has_rt_info (["runtime_options" , "KV_CACHE_PRECISION" ]))
136
136
137
+ if task == "image-text-to-text" :
138
+ self .assertTrue (
139
+ ov_model .language_model .model .has_rt_info (["runtime_options" , "KV_CACHE_PRECISION" ])
140
+ )
141
+ self .assertTrue (
142
+ ov_model .language_model .model .has_rt_info (["runtime_options" , "ACTIVATIONS_SCALE_FACTOR" ])
143
+ )
144
+
137
145
if library_name == "diffusers" :
138
146
self .assertTrue (
139
147
ov_model .vae_encoder .model .has_rt_info (["runtime_options" , "ACTIVATIONS_SCALE_FACTOR" ])
You can’t perform that action at this time.
0 commit comments