Open sanbuphy opened 5 months ago
多谢大佬 colab免费GPU有24小时限制 刚想怎么本地化您这就搞出来了 不过对于小白还是有几处坑: 环境部署utf8的坑 解决完还会碰到torch装不上的坑(wheels轮子也跑不起来😅)搞定又会碰到cudnn版本坑 toml注释还有关键错误 win的环境变量还有cuda的坑 折腾半天总算能勉强转录了(虽然还有部分警告和报错) 另外翻译还是用不了 不开翻译只转录也会报错
WhisperTranslator_local.py", line 232, in <module>
del internLM2
NameError: name 'internLM2' is not defined
有些地方忘写了好像 问题还蛮多了 先凑活吧 大佬这个项目想小白友好可能还得改改
很棒~我想支持本地的llm模型会是各类开源ai应用接下来的一个大趋势。比如这个项目https://github.com/openai-translator/openai-translator 也刚刚宣布支持本地模型了,可以做很不错的参考。 本身任务可能不复杂,为用户提供一键式的环境配置是比较麻烦的。 另外我觉得你这个在config里配置参数的步骤可以简单用一个GUI去warp一下,能极大提高应用性。
多谢大佬 colab免费GPU有24小时限制 刚想怎么本地化您这就搞出来了 不过对于小白还是有几处坑: 环境部署utf8的坑 解决完还会碰到torch装不上的坑(wheels轮子也跑不起来😅)搞定又会碰到cudnn版本坑 toml注释还有关键错误 win的环境变量还有cuda的坑 折腾半天总算能勉强转录了(虽然还有部分警告和报错) 另外翻译还是用不了 不开翻译只转录也会报错
WhisperTranslator_local.py", line 232, in <module> del internLM2 NameError: name 'internLM2' is not defined
有些地方忘写了好像 问题还蛮多了 先凑活吧 大佬这个项目想小白友好可能还得改改
这是一处代码错误,感谢反馈,以修正;能详细看下翻译的报错吗?
很棒~我想支持本地的llm模型会是各类开源ai应用接下来的一个大趋势。比如这个项目https://github.com/openai-translator/openai-translator 也刚刚宣布支持本地模型了,可以做很不错的参考。 本身任务可能不复杂,为用户提供一键式的环境配置是比较麻烦的。 另外我觉得你这个在config里配置参数的步骤可以简单用一个GUI去warp一下,能极大提高应用性。
谢谢,目前我是在想说 怎么弄个简单gui 这个其实有点难
谢谢,目前我是在想说 怎么弄个简单gui 这个其实有点难
pyqt吧
这是一处代码错误,感谢反馈,以修正;能详细看下翻译的报错吗?
大佬 已Fork 说说小白从无到有碰到的几个坑(本地化就是win平台了)
torch
No
也会output srt和txt(影响不大)C:\Users\WhisperTranslator\whispertranslator\llm.py:148: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if self.model_path is not "":
C:\Users\AppData\Roaming\Python\Python310\site-packages\fuzzywuzzy\fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
Traceback (most recent call last):
File "C:\Users\WhisperTranslator\WhisperTranslator_local.py", line 155, in <module>
internLM2 = InternLM2(session_len=8096)
File "C:\Users\WhisperTranslator\whispertranslator\llm.py", line 144, in __init__
self.model = self._load_model(max_batch_size,session_len)
File "C:\Users\WhisperTranslator\whispertranslator\llm.py", line 151, in _load_model
pipe = pipeline("internlm/internlm2-chat-7b-4bits", backend_config=engine_config)
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\api.py", line 61, in pipeline
return AsyncEngine(model_path,
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\serve\async_engine.py", line 67, in __init__ self._build_turbomind(model_path=model_path,
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\serve\async_engine.py", line 107, in _build_turbomind
from lmdeploy import turbomind as tm
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\__init__.py", line 24, in <module> from .turbomind import TurboMind # noqa: E402
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\turbomind.py", line 26, in <module>
from .deploy.converter import (get_model_format, supported_formats,
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\converter.py", line 16, in <module>
from .target_model.base import OUTPUT_MODELS, TurbomindModelConfig
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\target_model\__init__.py", line 3, in <module>
from .w4 import TurbomindW4Model # noqa: F401
File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\target_model\w4.py", line 17, in <module>
import _turbomind as _tm # noqa: E402
ImportError: DLL load failed while importing _turbomind: 找不到指定的模块。
这是一处代码错误,感谢反馈,以修正;能详细看下翻译的报错吗?
大佬 已Fork 说说小白从无到有碰到的几个坑(本地化就是win平台了) 0. 环境这块碰了几个坑 虽说整好了一劳永逸 不过针对和我一样之前没搞过faster-whisper的小白提一嘴(以下默认已全局或针对性科学+环境变量 另外python不能用最新的(这也是玩过sd1.5+的老坑了 有点经验的一般缩在10-)不然会碰pip的各种坑 装都装不了 还有CUDA根据显卡定 我30+算半张新卡 装新的(12+)会缺旧版cudnn的.dll 得单独找来拷 装旧的(11-)会缺新版12的.dll 条件还挺苛刻 2. 两个requirements大佬您估计win平台手打的吧 保存时默认utf-8 py下会读不出而且转码失败装不了(linux下应该没问题 反正得转到二进制的才能读出来) 另外不知是不是我个人碰到的 pytorch装不上 会提示应该用
torch
3. toml里language jp注释写错了 export_srt部分没用No
也会output srt和txt(影响不大) 4. 最后翻译块 这个倒是不着急 主要转录不准的话 拿着错误百出的原文翻译可谓竹篮打水(目前测试即使beam都调高 large-v2依旧不太准 优势是断句和语气词+背景音乐识别相对好点 v3确实准些但极易出现repeat 满行的复读机还蛮鬼畜的) llm.py可能因为是您刚搞得吧 和local.py好像都还有不少处写错的(目前先用的Aya大推的别的本地翻译工具 毕竟这两块可以完全独立开 )具体报错信息:C:\Users\WhisperTranslator\whispertranslator\llm.py:148: SyntaxWarning: "is not" with a literal. Did you mean "!="? if self.model_path is not "": C:\Users\AppData\Roaming\Python\Python310\site-packages\fuzzywuzzy\fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') Traceback (most recent call last): File "C:\Users\WhisperTranslator\WhisperTranslator_local.py", line 155, in <module> internLM2 = InternLM2(session_len=8096) File "C:\Users\WhisperTranslator\whispertranslator\llm.py", line 144, in __init__ self.model = self._load_model(max_batch_size,session_len) File "C:\Users\WhisperTranslator\whispertranslator\llm.py", line 151, in _load_model pipe = pipeline("internlm/internlm2-chat-7b-4bits", backend_config=engine_config) File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\api.py", line 61, in pipeline return AsyncEngine(model_path, File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\serve\async_engine.py", line 67, in __init__ self._build_turbomind(model_path=model_path, File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\serve\async_engine.py", line 107, in _build_turbomind from lmdeploy import turbomind as tm File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\__init__.py", line 24, in <module> from .turbomind import TurboMind # noqa: E402 File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\turbomind.py", line 26, in <module> from .deploy.converter import (get_model_format, supported_formats, File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\converter.py", line 16, in <module> from .target_model.base import OUTPUT_MODELS, TurbomindModelConfig File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\target_model\__init__.py", line 3, in <module> from .w4 import TurbomindW4Model # noqa: F401 File "C:\Users\AppData\Roaming\Python\Python310\site-packages\lmdeploy\turbomind\deploy\target_model\w4.py", line 17, in <module> import _turbomind as _tm # noqa: E402 ImportError: DLL load failed while importing _turbomind: 找不到指定的模块。
lmdeploy check_env
我反馈一下问题给软件研发大哥
https://github.com/sanbuphy/WhisperTranslator