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
- 参考文档references/cli-reference.md1.2 KB
- 参考文档references/pretrained-models.md2.1 KB
- 参考文档references/troubleshooting.md1.2 KB
- 脚本scripts/smoke_pretrained_inference.py1.6 KB
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-inferBaseModel.from_pretrained(...)model.separate(...),separate(...),numpy_separate(...),torch_separate(...), orfile_separate(...)- Torch Hub, Hugging Face IDs, Zenodo URLs, or local
model.pthfiles available_models()/show_available_models()- long-file chunking with
LambdaOverlapAdd
What to do first
- Identify the checkpoint source:
- local serialized dict or
model.pth - public URL
- Hugging Face model ID
- Torch Hub usage
- local serialized dict or
- Decide whether the user wants:
- a tensor/numpy result
- files written next to the inputs
- a temporary smoke check only
- Choose the device explicitly when ambiguity matters.
asteroid-inferdefaults to CUDA if available, otherwise CPU.- Long file inference can optionally be wrapped in
LambdaOverlapAdd.
Standard workflow
- Read
references/pretrained-models.mdfor the model-loading matrix and cache behavior. - Read
references/cli-reference.mdfor the public CLI flags and file-handling rules. - Read
references/troubleshooting.mdwhen the model source, file type, or device choice looks suspicious. - Use
scripts/smoke_pretrained_inference.pyfor 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
LambdaOverlapAddbefore separating.
Output expectations
- Tensor or numpy inputs return separated arrays with a source dimension.
- File inputs create
*_estN.wavoutputs unless an output directory is set. - The CLI should print or save separated waveforms without requiring the original repository checkout.
Troubleshooting reminders
requestsmissing usually means the bundled runtime bootstrap was skipped; runpython scripts/install_runtime.pyfrom the skill output.librosamissing usually meansasteroid.dataor audio-visual helpers were imported without the optional audio dependency.- Sample-rate mismatches usually need
--resampleor a model whosesample_ratematches 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
- Load or serialize a tiny model.
- Round-trip it through
from_pretrained(...). - Run a tiny tensor separation call.
- Run a tiny file separation call if files are involved.
- 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
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.
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.
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.
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.
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.
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).