界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

model-io-and-prediction

model-io-and-prediction

【效率与协作】Load, save, inspect, edit, package, and predict with Core ML model artifacts using MLModel and spec utilities.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: model-io-and-prediction description: "Load, save, inspect, edit, package, and predict with Core ML model artifacts using MLModel and spec utilities." disable-model-invocation: true metadata: disco-role: operating license: BSD 3-Clause

Model I/O and Prediction

Use this sub-skill when the task is about operating on existing Core ML artifacts: .mlmodel, .mlpackage, specs, metadata, feature descriptions, prediction dictionaries, compute-unit selection, compiled models, or stateful prediction boundaries.

Start here:

Operating rules:

  1. Prefer spec-only inspection with coremltools.models.utils.load_spec when prediction is not required, especially on Linux.
  2. Treat MLModel.predict, CompiledMLModel, compute devices, compute plans, and stateful runtime calls as macOS Core ML runtime features unless the environment proves otherwise.
  3. Preserve artifact form: neural-network-style specs may be saved as .mlmodel; mlprogram models with external weights normally need .mlpackage and a valid weights_dir.
  4. Prediction inputs are dictionaries keyed by Core ML feature names. Use NumPy arrays for multi-array inputs and PIL images for image inputs.
  5. Route source model conversion to ../convert-models/, compression and weight optimization to ../optimize-models/, and MIL/debug utilities/custom passes to ../mil-and-debugging/.
我的收藏