FunASRNano is not registered
version: funasr 1.2.9
Use local downloaded Fun-ASR-Nano-2512 model.
assert model_class is not None, f'{kwargs["model"]} is not registered'
│ └ {'model': 'FunASRNano', 'model_conf': {'lsm_weight': 0.1, 'length_normalized_loss': True}, 'audio_encoder': 'SenseVoiceEncode...
└ None
AssertionError: FunASRNano is not registered
Seems that FunASRNano is not auto registered.
And FunASRNano in model.py don't support ndarray as input. Other models like sensevoice, paramformer support numpy array as input. This caused inconsistent inputs to the AutoModel generate function.
for data in data_in:
if isinstance(data, str):
new_data_in.append(
[
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": f"语音转写:<|startofspeech|>!{data}<|endofspeech|>",
},
{"role": "assistant", "content": "null"},
]
)
elif isinstance(data, torch.Tensor):
new_data_in.append(
[
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": f"语音转写:<|startofspeech|>!!<|endofspeech|>",
"audio": data,
},
{"role": "assistant", "content": "null"},
]
)
data_in = new_data_in
+1 In the meantime, any workaround to get started with FunASRNano?
+1 In the meantime, any workaround to get started with FunASRNano?
FunASRNano is not registered bug can be solved by importing FunASRNano from funasr.models.fun_asr_nano.model import FunASRNano manually.
+1 In the meantime, any workaround to get started with FunASRNano?
FunASRNano is not registered bug can be solved by importing FunASRNano
from funasr.models.fun_asr_nano.model import FunASRNanomanually.
Thanks a lot. You saved my day.
Just a side note, after importing FunASRNano, I ran into a problem of missing model.safetensors problem. It is noticed that the model.safetensors is not in the directory of Qwen3-0.6B, I downloaded the file from official Qwen3-0.6B and it is working now.
Thanks a lot!
Thanks! I encountered this same problem today, and your method fixed it.
It makes sense that they extracted Qwen3-0.6B to keep the models separate and avoid duplication. However, the usage instructions really should clarify that users need to download Qwen3-0.6B manually.
version: funasr 1.2.9
Use local downloaded Fun-ASR-Nano-2512 model.
assert model_class is not None, f'{kwargs["model"]} is not registered' │ └ {'model': 'FunASRNano', 'model_conf': {'lsm_weight': 0.1, 'length_normalized_loss': True}, 'audio_encoder': 'SenseVoiceEncode... └ None AssertionError: FunASRNano is not registeredSeems that FunASRNano is not auto registered.
And FunASRNano in model.py don't support ndarray as input. Other models like sensevoice, paramformer support numpy array as input. This caused inconsistent inputs to the
AutoModelgenerate function.for data in data_in: if isinstance(data, str): new_data_in.append( [ {"role": "system", "content": "You are a helpful assistant."}, { "role": "user", "content": f"语音转写:<|startofspeech|>!{data}<|endofspeech|>", }, {"role": "assistant", "content": "null"}, ] ) elif isinstance(data, torch.Tensor): new_data_in.append( [ {"role": "system", "content": "You are a helpful assistant."}, { "role": "user", "content": f"语音转写:<|startofspeech|>!!<|endofspeech|>", "audio": data, }, {"role": "assistant", "content": "null"}, ] ) data_in = new_data_in
将你的ndarray转换成torch.Tensor即可。
` audio_np = np.frombuffer(audio_in, dtype=np.int16).astype(np.float32)
audio_tensor = torch.from_numpy(audio_np).unsqueeze(0).to(args.device)
audio_tensor = audio_tensor.float() / 32768.0 `
@chengzhen123
args.device 这里的args怎么定义的?
同样的错误,啥时候会修复呢
试一下这个方法,手动注册FunASRNano from funasr.models.fun_asr_nano.model import FunASRNano from funasr.register import tables tables.model_classes["FunASRNano"] = FunASRNano from funasr import AutoModel
https://github.com/FunAudioLLM/Fun-ASR 这个项目下有个 model.py 复制到你当前目录,
trust_remote_code=True,
remote_code="./model.py",
加上这两个参数,
res = model.generate(
#input=path 改
input=[path]
#batch_size_s=60, 改
batch_size=1,
同 #2794 的解决方案:从源码安装最新版 pip install git+https://github.com/modelscope/FunASR.git,并确保安装了 tiktoken 和 huggingface_hub。