FunAudioLLM / SenseVoice

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

如何不输出【You are using the latest version of funasr-1.1.4】 #90

Closed CHEFRA closed 2 months ago

CHEFRA commented 2 months ago

问题

为什么用funasr包的很多函数,都会报这条信息,不经过这条就不开始推理。 在源代码的什么位置可以注释掉这个版本检查?

代码

from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_path = './SenseVoiceSmall'  # ms下载下来目录的名字

model = AutoModel(model=model_path)

res = model.generate(input="/Users/dfla/llmsdl/SenseVoiveSmall/app/SenseVoiceSmall/example/zh.mp3",
                     language="zh",
                     use_itn=True
                     )
text = rich_transcription_postprocess(res[0]["text"])
print(text)
# print(res)
Joy-word commented 2 months ago

AutoModel 中,有个参数 disable_update

CHEFRA commented 2 months ago

AutoModel 中,有个参数 disable_update

谢谢,下午自己看源码找到了。

auto_model.py 114-119 行:

try:
    from funasr.utils.version_checker import check_for_update

    check_for_update(disable=kwargs.get("disable_update", False))
except:
    pass

直接注释掉即可。 下面是具体位置。

cmd + click + check_for_update 找到 17-27 行

def check_for_update(disable=False):
    if disable:
        return
    current_version = version.parse(__version__)
    pypi_version = get_pypi_version("funasr")

    if current_version < pypi_version:
        print(f"New version available: {pypi_version}. Your current version is {current_version}.")
        print('Please use the command "pip install -U funasr" to upgrade.')
    else:
        print(f"You are using the latest version of funasr-{current_version}")