You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: optimum/intel/openvino/modeling_base.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -619,11 +619,13 @@ def _from_transformers(
619
619
)
620
620
compile_only=False
621
621
622
-
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
623
-
ifload_in_8bitisNoneandnotquantization_config:
624
-
ov_config=None
625
-
else:
626
-
ov_config=OVConfig(dtype="fp32")
622
+
ov_config=kwargs.get("ov_config")
623
+
ifov_configisNone:
624
+
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
Copy file name to clipboardExpand all lines: optimum/intel/openvino/modeling_decoder.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -306,11 +306,13 @@ def _from_transformers(
306
306
ifuse_cache:
307
307
task=task+"-with-past"
308
308
309
-
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
310
-
ifload_in_8bitisNoneandnotquantization_config:
311
-
ov_export_config=None
312
-
else:
313
-
ov_export_config=OVConfig(dtype="auto")
309
+
ov_export_config=kwargs.get("ov_config")
310
+
ifov_export_configisNone:
311
+
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
247
-
ifload_in_8bitisNoneandnotquantization_config:
248
-
ov_config=None
249
-
else:
250
-
ov_config=OVConfig(dtype="fp32")
246
+
ov_config=kwargs.get("ov_config")
247
+
ifov_configisNone:
248
+
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
249
+
ifload_in_8bitisNoneandnotquantization_config:
250
+
ov_config=None
251
+
else:
252
+
ov_config=OVConfig(dtype="fp32")
251
253
252
254
deffn_get_submodels(model):
253
255
return {"model_text": model.text}
@@ -368,11 +370,14 @@ def _from_transformers(
368
370
# would end-up removing the directory containing the underlying OpenVINO model
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
372
-
ifload_in_8bitisNoneandnotquantization_config:
373
-
ov_config=None
374
-
else:
375
-
ov_config=OVConfig(dtype="fp32")
373
+
ov_config=kwargs.get("ov_config")
374
+
375
+
ifov_configisNone:
376
+
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
Copy file name to clipboardExpand all lines: optimum/intel/openvino/modeling_seq2seq.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -602,11 +602,13 @@ def _from_transformers(
602
602
"Please provide openvino model obtained using optimum-cli or saved on disk using `save_pretrained`"
603
603
)
604
604
compile_only=False
605
-
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
606
-
ifload_in_8bitisNoneandnotquantization_config:
607
-
ov_config=None
608
-
else:
609
-
ov_config=OVConfig(dtype="fp32")
605
+
ov_config=kwargs.get("ov_config")
606
+
ifov_configisNone:
607
+
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
Copy file name to clipboardExpand all lines: optimum/intel/openvino/modeling_visual_language.py
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -660,12 +660,14 @@ def _from_transformers(
660
660
iftaskisNone:
661
661
task=cls.export_feature
662
662
663
-
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
664
-
ifload_in_8bitisNoneandnotquantization_config:
665
-
ov_config=None
666
-
else:
667
-
# Export in fp32 if compression won't be applied later
# If load_in_8bit and quantization_config not specified then ov_config is set to None and will be set by default in convert depending on the model size
666
+
ifload_in_8bitisNoneandnotquantization_config:
667
+
ov_config=None
668
+
else:
669
+
# Export in fp32 if compression won't be applied later
0 commit comments