Skip to content

Commit 1f0ab3a

Browse files
authored
Fix saving preprocessors for models with remote code (#633)
1 parent 3c7245a commit 1f0ab3a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

optimum/exporters/openvino/__main__.py

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class StoreAttr(object):
323323
fn_get_submodels=fn_get_submodels,
324324
preprocessors=preprocessors,
325325
device=device,
326+
trust_remote_code=trust_remote_code,
326327
**kwargs_shapes,
327328
)
328329

optimum/exporters/openvino/convert.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ def export_from_model(
493493
fn_get_submodels: Optional[Callable] = None,
494494
preprocessors: List = None,
495495
device: str = "cpu",
496+
trust_remote_code: bool = False,
496497
**kwargs_shapes,
497498
):
498499
if ov_config is not None and ov_config.quantization_config and not is_nncf_available():
@@ -605,7 +606,7 @@ def export_from_model(
605606
generation_config.save_pretrained(output)
606607

607608
model_name_or_path = model.config._name_or_path
608-
maybe_save_preprocessors(model_name_or_path, output)
609+
maybe_save_preprocessors(model_name_or_path, output, trust_remote_code=trust_remote_code)
609610

610611
files_subpaths = ["openvino_" + model_name + ".xml" for model_name in models_and_export_configs.keys()]
611612

0 commit comments

Comments
 (0)