FunAudioLLM / SenseVoice

Multilingual Voice Understanding Model
https://funaudiollm.github.io/
Other
2.6k stars 246 forks source link

sensevoice无法识别语音 FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead. #79

Closed Ikaros-521 closed 1 month ago

Ikaros-521 commented 1 month ago

Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

❓ Questions and Help

Before asking:

  1. search the issues.
  2. search the docs.

What is your question?

识别完成后,识别内容是空的

e:\GitHub_pro\AI-Vtuber\Miniconda3\lib\site-packages\rotary_embedding_torch\rotary_embedding_torch.py:35: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  @autocast(enabled = False)
e:\GitHub_pro\AI-Vtuber\Miniconda3\lib\site-packages\rotary_embedding_torch\rotary_embedding_torch.py:262: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  @autocast(enabled = False)
You are using the latest version of funasr-1.1.3
Loading remote code successfully: ./sensevoice/model.py
e:\GitHub_pro\AI-Vtuber\Miniconda3\lib\site-packages\funasr\train_utils\load_pretrained_model.py:38: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  src_state = torch.load(path, map_location=map_location)

Code

sense_voice_model = AutoModel(
    model=asr_model_path,
    vad_model=vad_model_path,
    vad_kwargs={
        "max_single_segment_time": int(
            config.get(
                "talk", "sensevoice", "vad_max_single_segment_time"
            )
        )
    },
    trust_remote_code=True,
    device=config.get("talk", "sensevoice", "device"),
    remote_code="./sensevoice/model.py",
)
res = sense_voice_model.generate(
    input=WAVE_OUTPUT_FILENAME,
    cache={},
    language=config.get("talk", "sensevoice", "language"),
    text_norm=config.get("talk", "sensevoice", "text_norm"),
    batch_size_s=int(
        config.get("talk", "sensevoice", "batch_size_s")
    ),
    batch_size=int(
        config.get("talk", "sensevoice", "batch_size")
    ),
)

What have you tried?

能识别的情况下 不会有这些警告

What's your environment?

Ikaros-521 commented 1 month ago

torch 降到2.3.0 - 据说解决了