GLM-4 icon indicating copy to clipboard operation
GLM-4 copied to clipboard

https://hf-mirror.com/THUDM/glm-4-9b/resolve/main/tokenization_chatglm.py Content-Length 为空导致程序异常

Open heming79 opened this issue 2 years ago • 8 comments

System Info / 系統信息

ubuntu 22.04 torch 2.3.0 torchvision 0.17.1 transformers 4.41.2

Who can help? / 谁可以帮助到您?

No response

Information / 问题信息

  • [ ] The official example scripts / 官方的示例脚本
  • [ ] My own modified scripts / 我自己修改的脚本和任务

Reproduction / 复现过程

HfFileMetadata(commit_hash='911e84c3a2e84b234e20e5a8fda399c618e0ffc4', etag='1fb01ee2f9c4d0ab661242c8a6f3a12b01a65dae', location='https://hf-mirror.com/THUDM/glm-4-9b/resolve/main/tokenization_chatglm.py', size=None) Could not locate the tokenization_chatglm.py inside THUDM/glm-4-9b. Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1758, in _get_metadata_or_catch_error raise FileMetadataError("Distant resource does not have a Content-Length.")

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 399, in cached_file resolved_file = hf_hub_download( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download return _hf_hub_download_to_cache_dir( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1830, in _raise_on_head_call_error raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/data/heming/GLM-4/basic_demo/vllm_cli_demo.py", line 46, in engine, tokenizer = load_model_and_tokenizer(MODEL_PATH) File "/data/heming/GLM-4/basic_demo/vllm_cli_demo.py", line 37, in load_model_and_tokenizer tokenizer = AutoTokenizer.from_pretrained( File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/tokenization_auto.py", line 861, in from_pretrained tokenizer_class = get_class_from_dynamic_module(class_ref, pretrained_model_name_or_path, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 501, in get_class_from_dynamic_module final_module = get_cached_module_file( File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 305, in get_cached_module_file resolved_module_file = cached_file( File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 442, in cached_file raise EnvironmentError( OSError: We couldn't connect to 'https://hf-mirror.com' to load this file, couldn't find it in the cached files and it looks like THUDM/glm-4-9b is not the path to a directory containing a file named tokenization_chatglm.py. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

Expected behavior / 期待表现

https://hf-mirror.com/THUDM/glm-4-9b/resolve/main/tokenization_chatglm.py header里面 Content-Length 不要为空

heming79 avatar Jun 07 '24 09:06 heming79

我也遇到了这个问题,上周四之前还是没有的

KZhang152 avatar Jun 12 '24 07:06 KZhang152

我也遇到这个问题了

shiwl0329 avatar Jun 13 '24 02:06 shiwl0329

我也遇到了同样的问题

ZSYTJ avatar Jun 20 '24 04:06 ZSYTJ

已经复现,但是暂时没有发现怎么处理,初步怀疑是下载顺序的问题,我暂时没能解决

zRzRzRzRzRzRzR avatar Jun 21 '24 03:06 zRzRzRzRzRzRzR

解决了吗

Fiona-cn avatar Jun 21 '24 22:06 Fiona-cn

先手动下这一个单独的文件吧,应该就是差一个文件。这里有一个相似问题,暂时没看到解决方案,我会继续跟进

zRzRzRzRzRzRzR avatar Jun 22 '24 16:06 zRzRzRzRzRzRzR

@zRzRzRzRzRzRzR 重新在运行一次就行了,虽然他还是提示不完整,但是我对比文件大小是完整的。

Fiona-cn avatar Jun 23 '24 12:06 Fiona-cn

那应该就是一次下载文件太大了么

zRzRzRzRzRzRzR avatar Jun 23 '24 18:06 zRzRzRzRzRzRzR