diff --git a/mcp/src/olive_mcp/jobs.py b/mcp/src/olive_mcp/jobs.py index 206a73418..fd98ce9c7 100644 --- a/mcp/src/olive_mcp/jobs.py +++ b/mcp/src/olive_mcp/jobs.py @@ -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: diff --git a/mcp/src/olive_mcp/tools.py b/mcp/src/olive_mcp/tools.py index acb20afcb..a01935034 100644 --- a/mcp/src/olive_mcp/tools.py +++ b/mcp/src/olive_mcp/tools.py @@ -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() diff --git a/olive/cli/model_package.py b/olive/cli/model_package.py index e97a8499b..6cc5f90f2 100644 --- a/olive/cli/model_package.py +++ b/olive/cli/model_package.py @@ -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..filename`` references in the source's ``genai_config.json``) are excluded from this sweep — they're copied per-variant into ``models///`` and have @@ -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. """ @@ -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: @@ -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.") @@ -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 diff --git a/test/cli/test_model_package.py b/test/cli/test_model_package.py index 081f76bc6..ec8ca9c94 100644 --- a/test/cli/test_model_package.py +++ b/test/cli/test_model_package.py @@ -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 @@ -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")