计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
pretrained-inference【效率与协作】Guides SpeechBrain pretrained inference interfaces, Hugging Face or local model loading, audio normalization, G2P/text inference, profiling, and model-cache troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the user wants to run or debug SpeechBrain pretrained models, local model folders, Hugging Face sources, direct inference APIs, or model-cache/download behavior.
foreign_class package?references/inference-interfaces.md to choose the class and method.references/workflows.md for standard loading, audio, batch, local/offline, and custom-model flows.references/text-and-g2p.md.references/profiling.md before running any benchmark.references/troubleshooting.md.scripts/pretrained_interface_smoke.py when you only need to verify class availability and signatures without downloading models.from speechbrain.inference.ASR import EncoderDecoderASR
asr = EncoderDecoderASR.from_hparams(
source="speechbrain/asr-conformer-transformerlm-librispeech",
savedir="pretrained_models/asr-conformer-transformerlm-librispeech",
run_opts={"device": "cpu"},
)
text = asr.transcribe_file("audio.wav")
For a CUDA run, install a CUDA-capable Torch/Torchaudio pair first and set run_opts={"device": "cuda"} or an explicit device such as cuda:0. Validate CUDA separately; a CPU import check is not a CUDA verification.
from_hparams loads HyperPyYAML and checkpoint files. Treat untrusted hparams as executable configuration.foreign_class fetches and executes external Python code. Use it only for highly trusted sources.