Closed hahajinghuayuan closed 1 year ago
现在我在autodl上运行wenda项目,想接入baichuan-13b-chat模型,目前(pip install transformers==4.33.1已经执行完毕)。使用的是llm_baichuan.py文件。但运行显示结果:2023-09-14 13:27:18.010 | ERROR | main:load_LLM:37 - cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) Traceback (most recent call last):
File "/root/wenda/wenda.py", line 41, in
File "/root/wenda/wenda.py", line 34, in load_LLM LLM = importmodule('llms.llm'+settings.llm_type) │ └ {'logging': False, 'port': 6006, 'library': {'strategy': 'calc:0 rtst:2 agents:0', 'count': 5, 'step': 2}, 'librarys': {'bing... └ <function import_module at 0x7fb991253b50>
File "/root/miniconda3/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
│ │ │ │ │ └ 0
│ │ │ │ └ None
│ │ │ └ 0
│ │ └ 'llms.llm_baichuan'
│ └ <function _gcd_import at 0x7fb99132b400>
└ <module '_frozen_importlib' (frozen)>
File "
File "/root/wenda/llms/llm_baichuan.py", line 2, in
ImportError: cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) LLM模型加载失败,请阅读说明:https://github.com/l15y/wenda cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) Exception in thread Thread-1 (load_model): Traceback (most recent call last): File "/root/miniconda3/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/root/miniconda3/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/root/wenda/wenda.py", line 53, in load_model LLM.load_model() AttributeError: 'NoneType' object has no attribute 'load_model' No sentence-transformers model found with name /root/autodl-tmp/m3e/m3e-base. Creating a new one with MEAN pooling. 知识库加载完成
解决了吗,我也有相同的问题。我是在linux 下在执行的 python wenda -t baichuan
cannot import name 'TextIteratorStreamer' from 'transformers',应该是transformers版本问题
升级transformes版本就行了
2023-09-14 13:27:18.010 | ERROR | main:load_LLM:37 - cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) Traceback (most recent call last):
File "/root/wenda/wenda.py", line 41, in
LLM = load_LLM()
└ <function load_LLM at 0x7fb99132bd90>
File "/root/miniconda3/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) │ │ │ │ │ └ 0 │ │ │ │ └ None │ │ │ └ 0 │ │ └ 'llms.llm_baichuan' │ └ <function _gcd_import at 0x7fb99132b400> └ <module '_frozen_importlib' (frozen)> File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/root/wenda/llms/llm_baichuan.py", line 2, in
from transformers import TextIteratorStreamer
ImportError: cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) LLM模型加载失败,请阅读说明:https://github.com/l15y/wenda cannot import name 'TextIteratorStreamer' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py) Exception in thread Thread-1 (load_model): Traceback (most recent call last): File "/root/miniconda3/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/root/miniconda3/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/root/wenda/wenda.py", line 53, in load_model LLM.load_model() AttributeError: 'NoneType' object has no attribute 'load_model' No sentence-transformers model found with name /root/autodl-tmp/m3e/m3e-base. Creating a new one with MEAN pooling. 知识库加载完成