Skip to content

Commit 8f42a5c

Browse files
sstrehlkCopilotsbalandi
authored
Support from-onnx parameter (openvinotoolkit#2441)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sofya Balandina <sofya.balandina@intel.com>
1 parent b5a8f6f commit 8f42a5c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tools/who_what_benchmark/whowhatbench/model_loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def load_text_model(
139139
from optimum.intel.openvino import OVModelForCausalLM
140140
try:
141141
model = OVModelForCausalLM.from_pretrained(
142-
model_id, device=device, ov_config=ov_config
142+
model_id, device=device, ov_config=ov_config, **kwargs
143143
)
144144
except Exception:
145145
try:

tools/who_what_benchmark/whowhatbench/wwb.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ def parse_args():
174174
default=42,
175175
help="Text-to-image specific parameter that defines the seed value.",
176176
)
177+
parser.add_argument(
178+
"--from-onnx",
179+
action="store_true",
180+
help="If True, the model will be loaded from ONNX format. It's converted to OpenVINO format in runtime.",
181+
)
177182
parser.add_argument(
178183
"--adapters",
179184
type=str,
@@ -193,7 +198,6 @@ def parse_args():
193198
action='store_true',
194199
help="LLMPipeline specific parameter that defines the use of a long context prompt.",
195200
)
196-
197201
parser.add_argument(
198202
"--empty_adapters",
199203
action="store_true",
@@ -586,13 +590,15 @@ def main():
586590
kwargs = {}
587591
if args.cb_config:
588592
kwargs["cb_config"] = read_cb_config(args.cb_config)
593+
if args.from_onnx:
594+
kwargs["from_onnx"] = args.from_onnx
595+
kwargs["use_cache"] = False
589596
if args.adapters is not None:
590597
kwargs["adapters"] = args.adapters
591598
if args.alphas is not None:
592599
kwargs["alphas"] = args.alphas
593600
else:
594601
kwargs["alphas"] = [1.0] * len(args.adapters)
595-
596602
kwargs["empty_adapters"] = args.empty_adapters
597603

598604
if args.gt_data and os.path.exists(args.gt_data):

0 commit comments

Comments
 (0)