AGENT SKILL

pretrained-inference

Load Asteroid pretrained checkpoints and separate audio tensors, arrays, or files.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
pretrained-inference
license
MIT
metadata
{ "disco-role": "operating" }
description
Load Asteroid pretrained checkpoints and separate audio tensors, arrays, or files.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Pretrained inference

Use this sub-skill when the user wants to apply an existing Asteroid model rather than build or train one.

Typical triggers

  • asteroid-infer
  • BaseModel.from_pretrained(...)
  • model.separate(...), separate(...), numpy_separate(...), torch_separate(...), or file_separate(...)
  • Torch Hub, Hugging Face IDs, Zenodo URLs, or local model.pth files
  • available_models() / show_available_models()
  • long-file chunking with LambdaOverlapAdd

What to do first

  1. Identify the checkpoint source:
    • local serialized dict or model.pth
    • public URL
    • Hugging Face model ID
    • Torch Hub usage
  2. Decide whether the user wants:
    • a tensor/numpy result
    • files written next to the inputs
    • a temporary smoke check only
  3. Choose the device explicitly when ambiguity matters.
    • asteroid-infer defaults to CUDA if available, otherwise CPU.
    • Long file inference can optionally be wrapped in LambdaOverlapAdd.

Standard workflow

  • Read references/pretrained-models.md for the model-loading matrix and cache behavior.
  • Read references/cli-reference.md for the public CLI flags and file-handling rules.
  • Read references/troubleshooting.md when the model source, file type, or device choice looks suspicious.
  • Use scripts/smoke_pretrained_inference.py for a tiny local round-trip on tensors and files.

Common path choices

  • Local checkpoint: call BaseModel.from_pretrained(path_or_conf).
  • Public model name: resolve through BaseModel.from_pretrained(...) or Torch Hub.
  • Audio files: call model.separate(path) or the CLI with --files.
  • Long files: wrap the model in LambdaOverlapAdd before separating.

Output expectations

  • Tensor or numpy inputs return separated arrays with a source dimension.
  • File inputs create *_estN.wav outputs unless an output directory is set.
  • The CLI should print or save separated waveforms without requiring the original repository checkout.

Troubleshooting reminders

  • requests missing usually means the bundled runtime bootstrap was skipped; run python scripts/install_runtime.py from the skill output.
  • librosa missing usually means asteroid.data or audio-visual helpers were imported without the optional audio dependency.
  • Sample-rate mismatches usually need --resample or a model whose sample_rate matches the input.
  • Existing output files need --force-overwrite.

Inputs to inspect

  • checkpoint source and format
  • sample rate and channel count
  • whether the request is tensor, numpy, file, or folder based
  • whether the user wants a one-off smoke or a reusable separation recipe

Smoke sequence

  1. Load or serialize a tiny model.
  2. Round-trip it through from_pretrained(...).
  3. Run a tiny tensor separation call.
  4. Run a tiny file separation call if files are involved.
  5. Add overlap-add only when the request mentions long files or chunking.

What to avoid

  • Do not tell the user to rely on the original checkout at runtime.
  • Do not imply that a remote model download is guaranteed to work offline.
  • Do not hide a sample-rate mismatch behind a vague error message.
  • Do not use model-sharing guidance unless the user is actually preparing an upload.

Output shapes to remember

  • tensor and numpy paths keep a source dimension in the output
  • file paths write WAV files next to the input or in the requested output directory
  • overlap-add should preserve the source dimension while chunking long signals

Good questions to ask when unclear

  • Is the checkpoint local or remote?
  • Do you want files or in-memory arrays?
  • Should the output be forced onto CPU or a specific CUDA device?
  • Is this a short clip or a long-file inference problem?

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351