VLM-Captioning-Tools
VLM-Captioning-Tools copied to clipboard
Error while running the CogVLM captioning tool
I changed the paths and ran the script in google colab
Error:
`Downloading shards: 0% 0/8 [01:21<?, ?it/s]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 748, in _error_catcher
yield
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 894, in _raw_read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(3441326870 bytes read, 1497558314 more expected)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 820, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 1060, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 977, in read
data = self._raw_read(amt)
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 872, in _raw_read
with self._error_catcher():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/dist-packages/urllib3/response.py", line 772, in _error_catcher
raise ProtocolError(arg, e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(3441326870 bytes read, 1497558314 more expected)', IncompleteRead(3441326870 bytes read, 1497558314 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/content/drive/MyDrive/SuperGlobal/cogvlm_captioning_tool.py", line 267, in <module>
model = AutoModelForCausalLM.from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
return model_class.from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 3715, in from_pretrained
resolved_archive_file, sharded_metadata = get_checkpoint_shard_files(
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 1079, in get_checkpoint_shard_files
cached_filename = cached_file(
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 402, in cached_file
resolved_file = hf_hub_download(
File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
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 1240, 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 1389, in _hf_hub_download_to_cache_dir
_download_to_tmp_and_move(
File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1916, in _download_to_tmp_and_move
http_get(
File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 549, in http_get
for chunk in r.iter_content(chunk_size=DOWNLOAD_CHUNK_SIZE):
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 822, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(3441326870 bytes read, 1497558314 more expected)', IncompleteRead(3441326870 bytes read, 1497558314 more expected))
`
@ProGamerGov
@J-A-Varsha Sorry for the late reply, it seems like something it wrong with one of your HuggingFace repos or directory structure. There's no no download path setup in my code.
These posts may help you deal with the issue:
https://stackoverflow.com/questions/63312859/how-to-change-huggingface-transformers-default-cache-directory
If not, then you may need to ask on the HuggingFace Discord or github repos.