Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions optimum/commands/export/openvino.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ def parse_args_openvino(parser: "ArgumentParser"):
type=json.loads,
help=("Any kwargs passed to the model forward, or used to customize the export for a given model."),
)
optional_group.add_argument(
"--input-shapes",
type=json.loads,
default=None,
help=(
"Override the default shapes used during export. Provide shapes as JSON, e.g., "
'\'{{"batch_size": 1, "sequence_length": 128}}\' for static shapes. '
"Common shape parameters include: batch_size, sequence_length, height, width, num_channels."
),
)


def no_compression_parameter_provided(args):
Expand Down Expand Up @@ -464,7 +474,6 @@ def run(self):
output = Path(self.args.output)

try:
# TODO : add input shapes
main_export(
model_name_or_path=self.args.model,
output=output,
Expand All @@ -479,7 +488,7 @@ def run(self):
library_name=library_name,
variant=self.args.variant,
model_kwargs=self.args.model_kwargs,
# **input_shapes,
**(self.args.input_shapes or {}),
)
if apply_main_quantize:
_main_quantize(
Expand Down