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"])
所有评论(0)