请求为fun_asr_nano添加pcm、numpy直接推理 #2798
Closed
kenneth55555
started this conversation in
Ideas
Replies: 1 comment
-
|
FunASR 已经支持 numpy array 直接推理: import numpy as np
from funasr import AutoModel
model = AutoModel(model="FunAudioLLM/Fun-ASR-Nano-2512", hub="hf", trust_remote_code=True, device="cuda")
# numpy array 直接输入
audio_np = np.random.randn(16000).astype(np.float32) # 1秒16kHz音频
result = model.generate(input=audio_np)PCM bytes 可以先转为 numpy: import numpy as np
pcm_bytes = b"..." # 16bit PCM
audio_np = np.frombuffer(pcm_bytes, dtype=np.int16).astype(np.float32) / 32768.0
result = model.generate(input=audio_np) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1 必须保存成磁盘文件无法在纯内存中操作音频,是硬伤
2 加载时内存占用太疯了,显存占用明明只有2.2G,加载时却要12G以上内存,内存涨价,救救孩子吧
3 有没办法关掉时间戳,只输出推理文本,这应该能加快一丢丢推理速度
Beta Was this translation helpful? Give feedback.
All reactions