Giter Club home page Giter Club logo

Comments (3)

little51 avatar little51 commented on July 26, 2024

非常感谢,我按您的思路改了一下,做了一下判断。r.status_code应该是返回404,这时候total_length设成 0也不能正常下载,所以我直接给返False了

from aliendao.

SMACY2017 avatar SMACY2017 commented on July 26, 2024

非常感谢您的及时回复!我希望在这里完整叙述一下出错的过程和您的修改后的效果。

初始问题描述

在运行最开始的版本时遇到了错误:

(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.

little51 avatar little51 commented on July 26, 2024

看一下r.status_code是多少?如果是200或206,r.headers.get('content-length')应该是有值的才对

from aliendao.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.