Skip to content
Merged
11 changes: 11 additions & 0 deletions docs/source/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ Run benchmarking using llm-eval.
:prog: olive
:path: benchmark

Generate Model Package
======================

Merge multiple model outputs into a model package with manifest and per-component metadata.

.. argparse::
:module: olive.cli.launcher
:func: get_cli_parser
:prog: olive
:path: generate-model-package

Providing Input Models
======================

Expand Down
8 changes: 4 additions & 4 deletions olive/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ def save_model(
):
"""Save a model from the cache to a given path."""
output_dir = Path(output_dir) if output_dir else Path.cwd()

# If output_dir has a suffix (like .onnx), it's a file path
# Use parent directory for saving files
actual_output_dir = output_dir.parent if output_dir.suffix else output_dir
if output_dir.suffix and not output_dir.is_dir():
actual_output_dir = output_dir.parent
else:
actual_output_dir = output_dir
actual_output_dir.mkdir(parents=True, exist_ok=True)

model_json = self.load_model(model_id)
Expand Down
2 changes: 2 additions & 0 deletions olive/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from olive.cli.generate_adapter import GenerateAdapterCommand
from olive.cli.generate_cost_model import GenerateCostModelCommand
from olive.cli.init import InitCommand
from olive.cli.model_package import ModelPackageCommand
from olive.cli.optimize import OptimizeCommand
from olive.cli.quantize import QuantizeCommand
from olive.cli.run import WorkflowRunCommand
Expand Down Expand Up @@ -54,6 +55,7 @@ def get_cli_parser(called_as_console_script: bool = True) -> ArgumentParser:
ConfigureQualcommSDKCommand.register_subcommand(commands_parser)
SharedCacheCommand.register_subcommand(commands_parser)
ExtractAdaptersCommand.register_subcommand(commands_parser)
ModelPackageCommand.register_subcommand(commands_parser)
BenchmarkCommand.register_subcommand(commands_parser)

return parser
Expand Down
Loading
Loading