@@ -74,31 +74,24 @@ def __init__(
74
74
OpenVINO™ Intermediate Representation (IR) format to accelerate end-to-end pipelines on \
75
75
Intel® architectures using OpenVINO™ runtime.
76
76
"""
77
- from pathlib import Path
78
77
from helm .common .optional_dependencies import handle_module_not_found_error
79
78
80
79
try :
81
80
from optimum .intel .openvino import OVModelForCausalLM
82
81
except ModuleNotFoundError as e :
83
82
handle_module_not_found_error (e , ["openvino" ])
84
83
85
- model_file = Path (pretrained_model_name_or_path ) / "openvino_model.xml"
86
- if model_file .exists ():
87
- export = False
88
- else :
89
- export = True
90
-
91
84
self .device = "cpu"
92
85
# Security issue: currently we trust remote code by default.
93
86
# We retain this temporarily to maintain reverse compatibility.
94
87
# TODO: Delete if-else and don't set trust_remote_code=True
95
88
if "trust_remote_code" in kwargs :
96
89
self .model = OVModelForCausalLM .from_pretrained (
97
- pretrained_model_name_or_path , export = export , ** kwargs
90
+ pretrained_model_name_or_path , export = True , ** kwargs
98
91
).to (self .device )
99
92
else :
100
93
self .model = OVModelForCausalLM .from_pretrained (
101
- pretrained_model_name_or_path , export = export , trust_remote_code = True , ** kwargs
94
+ pretrained_model_name_or_path , export = True , trust_remote_code = True , ** kwargs
102
95
).to (self .device )
103
96
else :
104
97
# Security issue: currently we trust remote code by default.
0 commit comments