Comments (3)
非常感谢,我按您的思路改了一下,做了一下判断。r.status_code应该是返回404,这时候total_length设成 0也不能正常下载,所以我直接给返False了
from aliendao.
非常感谢您的及时回复!我希望在这里完整叙述一下出错的过程和您的修改后的效果。
初始问题描述
在运行最开始的版本时遇到了错误:
(llm_env) [用户名@服务器 ChatGLM-Finetuning]$ python model_download.py --repo_id THUDM/chatglm3-6b --mirror
2 of 25(README.md)100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████|1M/1M [00:00<00:00
Traceback (most recent call last):
File "PATH/model_download.py", line 221, in <module>
download_model_from_mirror(
File "PATH/model_download.py", line 199, in download_model_from_mirror
if _download_model_from_mirror(_repo_id, _repo_type, _token, _e):
File "PATH/model_download.py", line 193, in _download_model_from_mirror
if not _download_file_resumable(url, file_name, i, len(files)):
File "PATH/model_download.py", line 135, in _download_file_resumable
total_length = int(r.headers.get('content-length'))
...
按照我所说的修改后的结果
可以正常下载:
(llm_env) [用户名@服务器 ChatGLM-Finetuning]$ python model_download.py --repo_id THUDM/chatglm3-6b --mirror
3 of 25(pytorch_model-00001-of-00007.bin) 1%|▌ |10M/1743M [00:14<413 of 25(pytorch_model-00001-of-00007.bin) 1%|▋ |11M/1743M [00:16<453 of 25(pytorch_model-00001-of-00007.bin) 1%|▋ |12M/1743M [00:17<413 of 25(pytorch_model-00001-of-00007.bin) 1%|▋ |13M/1743M [00:19<453 of 25(pytorch_model-00001-of-00007.bin) 1%|▊ |14M/1743M [00:20<413 of 25(pytorch_model-00001-of-00007.bin) 1%|▊ |15M/1743M [00:21<373 of 25(pytorch_model-00001-of-00007.bin) 1%|▉ |16M/1743M [00:23<433 of 25(pytorch_model-00001-of-00007.bin) 1%|▉ |17M/1743M [00:24<393 of 25(pytorch_model-00001-of-00007.bin) 1%|█ |18M/1743M [00:26<453 of 25(pytorch_model-00001-of-00007.bin) 1%|█
...
尝试您的最新修改
我刚刚尝试了一下您提出的直接返回 False
的方法,不能正常下载,结果如下:
(llm_env) [用户名@服务器 ChatGLM-Finetuning]$ python model_download.py --repo_id THUDM/chatglm3-6b --mirror
2024-01-28 20:03:16 THUDM/chatglm3-6b download :下载资源发生了错误,请使用正确的token
希望以上信息能有所帮助。再次感谢您的及时回复!
from aliendao.
看一下r.status_code是多少?如果是200或206,r.headers.get('content-length')应该是有值的才对
from aliendao.
Related Issues (20)
- 公司有代理的情况下,如何下载呢? HOT 5
- 下载后目录显示替身文件源文件指向缓存目录这是什么情况 HOT 3
- 下载资源发生了错误,请使用正确的token HOT 7
- 运行命令时报错 HOT 4
- 请问一下模型下载好后在哪个目录呢? HOT 1
- TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' HOT 3
- 下载时经常出现500错误 HOT 1
- 请求增加bigcode/starcoderdata的镜像 HOT 6
- 请求增加模型google/madlad400-3b-mt,。。。 HOT 1
- 礼问一下别的模型镜像会同步吗? HOT 1
- 不能从其他的镜像站拉取吗 HOT 2
- 请问带参数的数据集怎么下载 HOT 3
- 下载模型报错 HOT 1
- 下载某些模型,需要身份认证,应该怎么处理? HOT 1
- 希望增加功能,可以选择单独下载模型中的单个文件 HOT 4
- 现在镜像是停了吗?目前都下载不了! HOT 17
- 下载的镜像文件为0kb HOT 1
- 请尽快支持QWEN-14B模型下载,谢谢 HOT 1
- 礼问一下确定实现断点续传了吗 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliendao.