THUDM / VisualGLM-6B

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

运行cli_demo.py报错 #192

Open lzw-lzw opened 1 year ago

lzw-lzw commented 1 year ago

在运行cli_demo.py进行部署时报错如下: [2023-07-24 06:19:37,012] [INFO] [real_accelerator.py:133:get_accelerator] Setting ds_accelerator to cuda (auto detect) /remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory warn(f"Failed to load image Python extension: {e}")

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

[2023-07-24 06:19:39,268] [WARNING] Failed to load bitsandbytes:cannot import name 'LinearNF4' from 'bitsandbytes.nn' (/remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/bitsandbytes/nn/init.py) Exception ignored in: <function BaseFileLock.del at 0x7f0ad473d820> Traceback (most recent call last): File "/remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/filelock/_api.py", line 240, in del self.release(force=True) File "/remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/filelock/_api.py", line 201, in release with self._thread_lock: AttributeError: 'UnixFileLock' object has no attribute '_thread_lock' ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /remote-home/cwli/VisualGLM-6B/cli_demo.py:103 in │ │ │ │ 100 │ │ 101 │ │ 102 if name == "main": │ │ ❱ 103 │ main() │ │ 104 │ │ │ │ /remote-home/cwli/VisualGLM-6B/cli_demo.py:30 in main │ │ │ │ 27 │ args = parser.parse_args() │ │ 28 │ │ │ 29 │ # load model │ │ ❱ 30 │ model, model_args = AutoModel.from_pretrained( │ │ 31 │ │ args.from_pretrained, │ │ 32 │ │ args=argparse.Namespace( │ │ 33 │ │ fp16=True, │ │ │ │ /remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/sat/model/base_model.py:31 │ │ 0 in from_pretrained │ │ │ │ 307 │ @classmethod │ │ 308 │ def from_pretrained(cls, name, args=None, *, home_path=None, url=None, prefix='', bu │ │ 309 │ │ if build_only or 'model_parallel_size' not in overwrite_args: │ │ ❱ 310 │ │ │ return cls.from_pretrained_base(name, args=args, home_path=home_path, url=ur │ │ 311 │ │ else: │ │ 312 │ │ │ new_model_parallel_size = overwrite_args['model_parallel_size'] │ │ 313 │ │ │ model, model_args = cls.from_pretrained_base(name, args=args, home_path=home │ │ │ │ /remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/sat/model/base_model.py:28 │ │ 5 in from_pretrained_base │ │ │ │ 282 │ │ if os.path.exists(name) and os.path.isdir(name): │ │ 283 │ │ │ model_path = name │ │ 284 │ │ else: │ │ ❱ 285 │ │ │ model_path = auto_create(name, path=home_path, url=url) │ │ 286 │ │ if args is None: │ │ 287 │ │ │ args = argparse.Namespace() # null, fill later │ │ 288 │ │ │ null_args = True │ │ │ │ /remote-home/cwli/anaconda3/envs/minigpt4/lib/python3.9/site-packages/sat/resources/download.py: │ │ 50 in auto_create │ │ │ │ 47 │ if url == 'local': │ │ 48 │ │ return model_path │ │ 49 │ os.makedirs(os.path.dirname(model_path), exist_ok=True) │ │ ❱ 50 │ lock = FileLock(model_path + '.lock', mode=0o777) │ │ 51 │ with lock: │ │ 52 │ │ if url is None: │ │ 53 │ │ │ url = MODEL_URLS[name] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ TypeError: init() got an unexpected keyword argument 'mode' 请问这是什么问题呢

1049451037 commented 1 year ago

pip install filelock --upgrade

lzw-lzw commented 1 year ago

解决了 谢谢