1. 示例

from funasr import AutoModel
model_dir = "FunAudioLLM/Fun-ASR-Nano-2512"
model = AutoModel(
    model=model_dir,
    trust_remote_code=True,
    remote_code="./model.py",  
    device="mps",          
)
wav_path = f"zh.wav"
res = model.generate(input=[wav_path], cache={}, batch_size=1)
print("识别结果:", res[0]["text"])
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐