modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.95k stars 738 forks source link

python 3.12 import FunASR的SyntaxWarning信息 #2137

Closed is closed 1 month ago

is commented 1 month ago

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

🐛 Bug

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. Run cmd '....'
    import funasr

    python -m m0

  2. See error
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:65: SyntaxWarning: invalid escape sequence '\['
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:124: SyntaxWarning: invalid escape sequence '\['
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:135: SyntaxWarning: invalid escape sequence '\['
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:256: SyntaxWarning: invalid escape sequence '\['
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:277: SyntaxWarning: invalid escape sequence '\['
    /data/c/envs/sensevoice/lib/python3.12/site-packages/funasr/models/fsmn_kws/encoder.py:300: SyntaxWarning: invalid escape sequence '\['

Code sample

Expected behavior

FunASR/funasr/models/fsmn_kw/encoder.py中的代码

splits = line.strip().strip('\[\]').strip().split()

应该

splits = line.strip().strip('[]').strip().split()

就可以了.

Environment

python                  3.12.7
funasr                   1.1.11
modelscope               1.18.1

Additional context

hongfanmeng commented 3 weeks ago

这个问题是还没解决吗