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

modelscope-funasr这个问题怎么解决?

modelscope-funasr这个问题怎么解决? demo ERROR. Real-time transcription service ONLY SUPPORT wav_format pcm.用的是funasr-runtime-resources/samples/audio/asr_example.wav
部署步骤
curl -O https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/shell/funasr-runtime-deploy-offline-cpu-zh.sh
sudo bash funasr-runtime-deploy-offline-cpu-zh.sh install --workspace ./funasr-runtime-resources
python3 funasr_wss_client.py --host "127.0.0.1" --port 10098 --mode offline --audio_in "../audio/asr_example.wav" --output_dir .

在我们服务器上部署很多次, 都没问题。 昨天在客户环境部署。 同样的三条命令。 结果是
demo ERROR. Real-time transcription service ONLY SUPPORT wav_format pcm.

展开
收起
三分钟热度的鱼 2024-02-01 17:17:28 55 0
1 条回答
写回答
取消 提交回答
  • 是wav 44字节头的原因。出错的: if wav_path.endswith(".pcm"):
    with open(wav_path, "rb") as f:
    audio_bytes = f.read()
    else:
    wav_format = "others"
    with open(wav_path, "rb") as f:
    audio_bytes = f.read()
    正确的:if wav_path.endswith(".pcm"):
    with open(wav_path, "rb") as f:
    audio_bytes = f.read()
    elif wav_path.endswith(".wav"):
    import wave
    with wave.open(wav_path, "rb") as wav_file:
    params = wav_file.getparams()
    sample_rate = wav_file.getframerate()
    frames = wav_file.readframes(wav_file.getnframes())
    audio_bytes = bytes(frames)
    else:
    wav_format = "others"
    with open(wav_path, "rb") as f:
    audio_bytes = f.read() 此回答整理自钉群“modelscope-funasr社区交流”

    2024-02-01 18:08:32
    赞同 展开评论 打赏

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

热门讨论

热门文章

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载