File tree 2 files changed +7
-6
lines changed
optimum/exporters/openvino
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 47
47
_transformers_version ,
48
48
compare_versions ,
49
49
is_openvino_tokenizers_version ,
50
- is_openvino_version ,
51
50
is_tokenizers_version ,
52
51
is_transformers_version ,
53
52
)
@@ -437,9 +436,7 @@ def ts_patched_forward(*args, **kwargs):
437
436
patcher .patched_forward = ts_patched_forward
438
437
439
438
ts_decoder_kwargs = {}
440
- if (library_name == "diffusers" or allow_skip_tracing_check (model )) and is_openvino_version (
441
- ">=" , "2025.0"
442
- ):
439
+ if allow_skip_tracing_check (library_name , model ):
443
440
ts_decoder_kwargs ["trace_kwargs" ] = {"check_trace" : False }
444
441
445
442
with patcher :
Original file line number Diff line number Diff line change 26
26
from optimum .exporters import TasksManager
27
27
from optimum .exporters .onnx .base import OnnxConfig
28
28
from optimum .intel .utils import is_transformers_version
29
- from optimum .intel .utils .import_utils import is_safetensors_available
29
+ from optimum .intel .utils .import_utils import is_openvino_version , is_safetensors_available
30
30
from optimum .utils import is_diffusers_available
31
31
from optimum .utils .save_utils import maybe_save_preprocessors
32
32
@@ -317,7 +317,11 @@ def save_preprocessors(
317
317
SKIP_CHECK_TRACE_MODELS = ("deepseek" , "deepseek-v2" , "deepseek-v3" )
318
318
319
319
320
- def allow_skip_tracing_check (model ):
320
+ def allow_skip_tracing_check (library_name , model ):
321
+ if is_openvino_version ("<" , "2025.0.0" ):
322
+ return False
323
+ if library_name == "diffusers" :
324
+ return True
321
325
config = getattr (model , "config" , {})
322
326
model_type = getattr (config , "model_type" , "" ).replace ("_" , "-" )
323
327
return model_type in SKIP_CHECK_TRACE_MODELS
You can’t perform that action at this time.
0 commit comments