File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ def from_pretrained(
459
459
460
460
ov_files = _find_files_matching_pattern (
461
461
model_dir ,
462
- pattern = r"(.*)?openvino(.*)?\_model(.*)?.xml$" ,
462
+ pattern = r"(.*)?openvino(.*)?\_model(.*)?.xml$" if kwargs . get ( "from_onnx" , False ) else r"model.onnx" ,
463
463
subfolder = subfolder ,
464
464
use_auth_token = token ,
465
465
revision = revision ,
@@ -477,6 +477,7 @@ def from_pretrained(
477
477
f"No OpenVINO files were found for { model_id } , setting `export=True` to convert the model to the OpenVINO IR. "
478
478
"Don't forget to save the resulting model with `.save_pretrained()`"
479
479
)
480
+ _export = False
480
481
except Exception as exception :
481
482
logger .warning (
482
483
f"Could not infer whether the model was already converted or not to the OpenVINO IR, keeping `export={ export } `.\n { exception } "
You can’t perform that action at this time.
0 commit comments