Git Product home page Git Product logo

Comments (8)

cgisky1980 avatar cgisky1980 commented on May 28, 2024

其他模型应该也有类似问题
另外问一句 能把自动更新给关了么?? /(ㄒoㄒ)/~~

from funasr.

LauraGPT avatar LauraGPT commented on May 28, 2024

好的,感谢反馈,我们内部测试一下

from funasr.

LauraGPT avatar LauraGPT commented on May 28, 2024

刚才确认了一下,代码一直是with autocast(False),应该是你那边自己有修改,更新funasr以后,被覆盖了,导致的问题。请问你做这个修改,是有什么特殊用途么?如果涉及到自己的项目,可以把这块pr,merge进funasr。funasr是需要更新的,不然无法使用最新feature,也没法下载modelscope最新的模型

from funasr.

cgisky1980 avatar cgisky1980 commented on May 28, 2024

奇怪 我啥也没改啊,之前好好的,然后突然就报错了 CPU Autocast only supports dtype of torch.bfloat16 currently. @@
不是特殊用途 而是报错执行不了啊
就是跑了两个模型


inference_pipline = pipeline(
       task=Tasks.voice_activity_detection,
       model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch",
       model_revision='v1.2.0',
       output_dir=None,
       batch_size=1,
   )

param_dict = dict()
param_dict['hotword']="小五 小五月" #设置热词,用空格隔开

inference_pipeline2 = pipeline(
       task=Tasks.auto_speech_recognition,
       model="damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404",
       param_dict=param_dict) 

from funasr.

cgisky1980 avatar cgisky1980 commented on May 28, 2024

pytorch/pytorch#55374

from funasr.

cgisky1980 avatar cgisky1980 commented on May 28, 2024

刚才确认了一下,代码一直是with autocast(False),应该是你那边自己有修改,更新funasr以后,被覆盖了,导致的问题。请问你做这个修改,是有什么特殊用途么?如果涉及到自己的项目,可以把这块pr,merge进funasr。funasr是需要更新的,不然无法使用最新feature,也没法下载modelscope最新的模型

我觉得这块可不可以做个设置开关 比如跑在生产环境中,不是太希望保持最新环境。

不是这块代码有问题,而是之前给的数据类型应该是支持的现在数据类型不被支持

这个警告是因为你在使用PyTorch的自动混合精度(autocast)功能时,指定了一个不受支持的数据类型(dtype)。目前,CPU autocast只支持torch.bfloat16这一种数据类型12。如果你想使用其他的数据类型,你需要禁用autocast或者切换到其他设备2

from funasr.

cgisky1980 avatar cgisky1980 commented on May 28, 2024

完整报错信息是这样的

/www/miniconda3/envs/vits2/lib/python3.7/site-packages/torch/amp/autocast_mode.py:214: UserWarning: In CPU autocast, but the target dtype is not supported. Disabling autocast.
CPU Autocast only supports dtype of torch.bfloat16 currently.
  warnings.warn(error_message)
Traceback (most recent call last):
  File "asr.py", line 161, in <module>
    rec_result = inference_pipeline2(audio_in=audio_in)
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/modelscope/pipelines/audio/asr_inference_pipeline.py", line 258, in __call__
    output = self.forward(output, **kwargs)
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/modelscope/pipelines/audio/asr_inference_pipeline.py", line 533, in forward
    inputs['asr_result'] = self.run_inference(self.cmd, **kwargs)
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/modelscope/pipelines/audio/asr_inference_pipeline.py", line 612, in run_inference
    cmd['fs'], cmd['param_dict'], **kwargs)
  File "/www/FunASR/funasr/bin/asr_inference_paraformer.py", line 728, in _forward
    results = speech2text(**batch)
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/www/FunASR/funasr/bin/asr_inference_paraformer.py", line 226, in __call__
    enc, enc_len = self.asr_model.encode(**batch)
  File "/www/FunASR/funasr/models/e2e_asr_paraformer.py", line 278, in encode
    with autocast(False):
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/torch/cuda/amp/autocast_mode.py", line 30, in __enter__
    return super().__enter__()
  File "/www/miniconda3/envs/vits2/lib/python3.7/site-packages/torch/amp/autocast_mode.py", line 238, in __enter__
    torch.set_autocast_cpu_dtype(self.fast_dtype)  # type: ignore[arg-type]
RuntimeError: Currently, AutocastCPU only support Bfloat16 as the autocast_cpu_dtype

from funasr.

LauraGPT avatar LauraGPT commented on May 28, 2024

好的,问题收到。关于更细遇到报错的问题,可以加我们钉钉群,更新前会提前1个礼拜在群里通知,你可以自己先测试,如果有问题,可以及时反馈给我们

from funasr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.