Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions mcp/src/olive_mcp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ async def _run_olive_background(
await proc.wait()
stdout_str = stdout_bytes.decode("utf-8", errors="replace")

# If the job was already cancelled, don't overwrite its status.
if _jobs[job_id]["status"] == "cancelled":
# If the job was already canceled, don't overwrite its status.
if _jobs[job_id]["status"] == "canceled":
return

if proc.returncode != 0:
Expand Down
8 changes: 4 additions & 4 deletions mcp/src/olive_mcp/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ async def cancel_job(job_id: str) -> dict:
_sp.call(["taskkill", "/F", "/T", "/PID", str(proc.pid)], stdout=_sp.DEVNULL, stderr=_sp.DEVNULL)
else:
proc.terminate()
_job_log(job_id, "Job cancelled by user")
_job_log(job_id, "Job canceled by user")

job["status"] = "cancelled"
job["result"] = {"status": "cancelled", "message": "Job was cancelled by user."}
return {"status": "cancelled", "job_id": job_id, "message": "Job cancelled."}
job["status"] = "canceled"
job["result"] = {"status": "canceled", "message": "Job was canceled by user."}
return {"status": "canceled", "job_id": job_id, "message": "Job canceled."}


@mcp.tool()
Expand Down
12 changes: 6 additions & 6 deletions olive/cli/model_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def _collect_config_files(targets: list[tuple[str, Path, dict]]) -> dict[str, Pa
config set.

Subdirectories that hold model artifacts (e.g. Mobius VLM's
``decoder/``, ``embedding/``, ``vision_encoder/``, recognised via
``decoder/``, ``embedding/``, ``vision_encoder/``, recognized via
the ``model.<role>.filename`` references in the source's
``genai_config.json``) are excluded from this sweep — they're
copied per-variant into ``models/<component>/<variant>/`` and have
Expand Down Expand Up @@ -442,7 +442,7 @@ def _variant_artifacts(v: VariantSpec) -> list[OnnxArtifact]:

When ``onnx_rel_paths`` is empty (legacy callers), the rel path defaults
to each source file's basename, preserving the original flat-layout
behaviour. When supplied (the CLI's genai_config-driven path), the rel
behavior. When supplied (the CLI's genai_config-driven path), the rel
path is used verbatim so multi-component sources land in matching
subdirectories under the variant dir.
"""
Expand Down Expand Up @@ -556,7 +556,7 @@ def _assign_role(role: str, component: str) -> None:
_assign_role(role_name, v.component_name)
# Fallback for components whose variants carried no usable source_genai:
# map the component name to itself as the role, matching the legacy
# writer behaviour for direct ``write_model_package`` callers.
# writer behavior for direct ``write_model_package`` callers.
for comp_name in components:
explicit_role = component_to_role.get(comp_name, comp_name)
if explicit_role not in role_to_component:
Expand Down Expand Up @@ -693,10 +693,10 @@ def _copy_with_collision_check(src: Path, dst: Path, *, skip_if_identical: bool
than choose a winner: silently keeping either copy could leave the
package referencing a stale or wrong blob. ``skip_if_identical`` is
accepted as an explicit-intent flag at the call site (the dedupe
behaviour is always on; the flag exists so the sidecar sweep reads
behavior is always on; the flag exists so the sidecar sweep reads
self-documenting).
"""
del skip_if_identical # behaviour is always content-aware; flag is documentation
del skip_if_identical # behavior is always content-aware; flag is documentation
if dst.exists():
if not dst.is_file():
raise FileExistsError(f"Cannot copy {src} to {dst}: destination exists and is not a regular file.")
Expand Down Expand Up @@ -886,7 +886,7 @@ def _lift_role_overlay_body(role_body: dict, onnx_rel_paths: Optional[list[str]]
has_pipeline = isinstance(pipeline, list) and pipeline
filename = role_body.get("filename")
# ``pipeline`` takes precedence when both are present (mirrors the
# behaviour of ``_collect_artifacts_per_role``, which only emits
# behavior of ``_collect_artifacts_per_role``, which only emits
# pipeline stage artifacts in that case). Lifting both would produce
# an overlay with both ``filename`` and ``pipeline`` (malformed for the
# loader) and reuse ``onnx_rel_paths[0]`` — which is stage 0's
Expand Down
4 changes: 2 additions & 2 deletions test/cli/test_model_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def test_base_genai_strips_per_variant_model_fields(self, tmp_path):
"""The base ``configs/genai_config.json`` must not carry per-variant fields.

If ``context_length`` (or similar) lived in the base, GenAI's overlay
merge would still honour the per-variant value (overlay scalar wins),
merge would still honor the per-variant value (overlay scalar wins),
but ``_VARIANT_LEVEL_MODEL_KEYS`` includes arrays (``eos_token_id``)
whose presence in the base would trigger GenAI's array-append merge
semantics — the merged result would duplicate the array. So the base
Expand Down Expand Up @@ -1521,7 +1521,7 @@ def test_configs_dir_excludes_model_artifact_subdirs(self, tmp_path):
Without explicit exclusion the config-file sweep would copy every
source-root directory (including the model-artifact subdirs), so the
package would carry duplicate ONNXs under ``configs/`` and bloat
the deliverable. The sweep recognises model-artifact subdirs via
the deliverable. The sweep recognizes model-artifact subdirs via
the genai_config's role filenames and skips them.
"""
src = _create_mobius_vlm_source(tmp_path, "cpu")
Expand Down
Loading