THUDM / VisualGLM-6B

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

sat模型下载出现ClientError #197

Closed EdwardKSG closed 1 year ago

EdwardKSG commented 1 year ago

跑web_demo.py时出现client error: botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden

完整stack trace如下: Failed to download or check, if you already had the zip file, please unzip it manually as /home/xx/.sat_models/visualglm-6b! Traceback (most recent call last): File "/home/xx/VisualGLM-6B-main/web_demo.py", line 130, in main(args) File "/home/xx/VisualGLM-6B-main/web_demo.py", line 84, in main model, tokenizer = get_infer_setting(gpu_device=0, quant=args.quant)

File "/home/xx/VisualGLM-6B-main/model/infer_util.py", line 21, in get_infer_setting model, args = VisualGLMModel.from_pretrained('visualglm-6b', args)

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/model/base_model.py", line 215, in from_pretrained return cls.from_pretrained_base(name, args=args, home_path=home_path, url=url, prefix=prefix, build_only=build_only, overwrite_args=overwrite_args, **kwargs)

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/model/base_model.py", line 201, in from_pretrained_base model_path = auto_create(name, path=home_path, url=url)

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/resources/download.py", line 68, in auto_create raise e File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/resources/download.py", line 62, in auto_create download_s3(path, url[5:]) File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/resources/download.py", line 107, in download_s3 bucket.download_file(remote_uri, os.path.join(local_dir, os.path.basename(remote_uri)),Callback=ProgressPercentage(client, SAT_BUCKET, remote_uri), Config=transfer_config)

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/sat/resources/download.py", line 133, in init self._size = client.head_object(Bucket=bucket, Key=filename)['ContentLength']

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/botocore/client.py", line 534, in _api_call return self._make_api_call(operation_name, kwargs)

File "/home/xx/anaconda3/envs/visualglm/lib/python3.11/site-packages/botocore/client.py", line 976, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden

1049451037 commented 1 year ago
Failed to download or check, if you already had the zip file, please unzip it manually as /home/xx/.sat_models/visualglm-6b!

按照提示删除缓存再试试呢

EdwardKSG commented 1 year ago

多谢回复 :) 缓存删除后还是有同样的error (也重新pull了VisualGLM-6B代码)

当前配置如下: Python 3.11.4 sat 0.4.3 filelock 3.12.2 torch 2.0.1 cuda 11.7

之前手动下载过清华云上的zip包,但是好像和最新版代码不适配,推理时生成内容有些异常,所以只能想办法下载cloudflare上的包了

1049451037 commented 1 year ago

https://stackoverflow.com/questions/41646514/trying-to-access-a-s3-bucket-using-boto3-but-getting-403

看起来可能是你的系统时间有问题,导致cloudflare认证失败

EdwardKSG commented 1 year ago

确实是这个问题,多谢