开发者社区 > ModelScope模型即服务 > 自然语言处理 > 正文

modelscope-funasr跑官方示例的时候,报错,怎么解决?

modelscope-funasr跑官方示例的时候,报错,怎么解决?报错如下python3.10,furasr==1.0.0
KeyError Traceback (most recent call last)
Cell In[3], line 4
1 from funasr import AutoModel
2 # paraformer-zh is a multi-functional asr model
3 # use vad, punc, spk or not as you need
----> 4 model = AutoModel(model="paraformer-zh", model_revision="v2.0.2",
5 vad_model="fsmn-vad", vad_model_revision="v2.0.2",
6 punc_model="ct-punc-c", punc_model_revision="v2.0.3",
7 # spk_model="cam++", spk_model_revision="v2.0.2",
8 )
9 res = model.generate(input=f"{model.model_path}/example/asr_example.wav",
10 batch_size_s=300,
11 hotword='魔搭')
12 print(res)

File e:\envs\py310\lib\site-packages\funasr\auto\auto_model.py:100, in AutoModel.init(self, kwargs)
98 logging.info("Building VAD model.")
99 vad_kwargs = {"model": vad_model, "model_revision": vad_kwargs}
--> 100 vad_model, vad_kwargs = self.build_model(
vad_kwargs)
102 # if punc_model is not None, build punc model else None
103 punc_model = kwargs.get("punc_model", None)

File e:\envs\py310\lib\site-packages\funasr\auto\auto_model.py:143, in AutoModel.build_model(self, kwargs)
141 if "model_conf" not in kwargs:
142 logging.info("download models from model hub: {}".format(kwargs.get("model_hub", "ms")))
--> 143 kwargs = download_model(
kwargs)
145 set_all_random_seed(kwargs.get("seed", 0))
147 device = kwargs.get("device", "cuda")

File e:\envs\py310\lib\site-packages\funasr\download\download_from_hub.py:11, in download_model(kwargs)
9 model_hub = kwargs.get("model_hub", "ms")
10 if model_hub == "ms":
---> 11 kwargs = download_from_ms(
kwargs)
13 return kwargs

File e:\envs\py310\lib\site-packages\funasr\download\download_from_hub.py:48, in download_from_ms(**kwargs)
46 conf_json = json.load(f)
47 cfg = {}
---> 48 add_file_root_path(model_or_path, conf_json["file_path_metas"], cfg)
49 cfg.update(kwargs)
50 config = OmegaConf.load(cfg["config"])

KeyError: 'file_path_metas'

展开
收起
三分钟热度的鱼 2024-02-01 16:57:53 497 0
0 条回答
写回答
取消 提交回答

包含命名实体识别、文本分类、分词、关系抽取、问答、推理、文本摘要、情感分析、机器翻译等多个领域

热门讨论

热门文章

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载