THUDM / VisualGLM-6B

Chinese and English multimodal conversational language model | 多模态中英双语对话语言模型
Apache License 2.0
4.09k stars 417 forks source link

linux环境缺少sat包且pip无法安装成功 #5

Closed ImGoodBai closed 1 year ago

ImGoodBai commented 1 year ago

$ python web_demo_hf.py Traceback (most recent call last): File "web_demo_hf.py", line 6, in model = AutoModel.from_pretrained("THUDM/visualglm-6b", trust_remote_code=True).half().cuda() File "/home/good/anaconda3/envs/visualglm/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 459, in from_pretrained model_class = get_class_from_dynamic_module( File "/home/good/anaconda3/envs/visualglm/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 425, in get_class_from_dynamic_module final_module = get_cached_module_file( File "/home/good/anaconda3/envs/visualglm/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 305, in get_cached_module_file get_cached_module_file( File "/home/good/anaconda3/envs/visualglm/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 267, in get_cached_module_file modules_needed = check_imports(resolved_module_file) File "/home/good/anaconda3/envs/visualglm/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 150, in check_imports raise ImportError( ImportError: This modeling file requires the following packages that were not found in your environment: sat. Run pip install sat

winnerahao commented 1 year ago

https://pypi.org/project/SwissArmyTransformer/0.3.6/#files 源码安装就好了,5月17发布的。。。pip还没更新吧

Sleepychord commented 1 year ago

包名是SwissArmyTransformer,而不是sat。只是该库import的时候是用sat,这两个名字可能不同。 这个Run pip install sat是Huggingface transformers的提示,是错误的,但是我没法改。 请使用pypi源(而非tuna,它更新太慢)安装最新版本的SwissArmyTransformer。

ImGoodBai commented 1 year ago

https://pypi.org/project/SwissArmyTransformer/0.3.6/#files

手动下载源码安装,搞定了。

xiaohujecky commented 1 year ago

VisualGLM-6B/model/blip2.py", line 4, in from SwissArmyTransformer.model import ViTModel, BaseModel ImportError: cannot import name 'ViTModel' from 'SwissArmyTransformer.model' 还是会有错误,有人遇到了吗

1049451037 commented 1 year ago

@xiaohujecky 代码里是from sat.model import ViTModel,为什么你的报错是from SwissArmyTransformer呢?

Sleepychord commented 1 year ago

@xiaohujecky 可能是版本不对,pip show SwissArmyTransformer 看看版本是不是0.3.6不是的话,要重新装,请用标准或者阿里云pip镜像装。