Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

429 Client Error: Too Many Requests for url: https://huggingface.co/api/models/monai-test/test_bundle/refs #7764

Closed
KumoLiu opened this issue May 13, 2024 · 0 comments · Fixed by #7765

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented May 13, 2024

[2024-05-11T23:12:50.607Z] ======================================================================
[2024-05-11T23:12:50.607Z] ERROR: test_hf_hub_download_bundle_0 (tests.test_bundle_download.TestDownload)
[2024-05-11T23:12:50.607Z] ----------------------------------------------------------------------
[2024-05-11T23:12:50.607Z] Traceback (most recent call last):
[2024-05-11T23:12:50.607Z]   File "/tmp/tmp.vyQ5lTRR71/tests/utils.py", line 809, in command_line_tests
[2024-05-11T23:12:50.607Z]     normal_out = subprocess.run(cmd, env=test_env, check=True, capture_output=True)
[2024-05-11T23:12:50.607Z]   File "/usr/lib/python3.10/subprocess.py", line 526, in run
[2024-05-11T23:12:50.607Z]     raise CalledProcessError(retcode, process.args,
[2024-05-11T23:12:50.607Z] subprocess.CalledProcessError: Command '['coverage', 'run', '-m', 'monai.bundle', 'download', '--name', 'test_bundle', '--source', 'huggingface_hub', '--bundle_dir', '/tmp/tmpj4nbldaz', '--repo', 'monai-test/test_bundle', '--progress', 'False']' returned non-zero exit status 1.
[2024-05-11T23:12:50.607Z] 
[2024-05-11T23:12:50.607Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.607Z] 
[2024-05-11T23:12:50.607Z] Traceback (most recent call last):
[2024-05-11T23:12:50.607Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
[2024-05-11T23:12:50.607Z]     return func(*(a + p.args), **p.kwargs, **kw)
[2024-05-11T23:12:50.607Z]   File "/tmp/tmp.vyQ5lTRR71/tests/test_bundle_download.py", line 154, in test_hf_hub_download_bundle
[2024-05-11T23:12:50.608Z]     command_line_tests(cmd)
[2024-05-11T23:12:50.608Z]   File "/tmp/tmp.vyQ5lTRR71/tests/utils.py", line 815, in command_line_tests
[2024-05-11T23:12:50.608Z]     raise RuntimeError(f"subprocess call error {e.returncode}: {errors}, {output}") from e
[2024-05-11T23:12:50.608Z] RuntimeError: subprocess call error 1: b'Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 304, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     response.raise_for_status()
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status
[2024-05-11T23:12:50.608Z]     raise HTTPError(http_error_msg, response=self)
[2024-05-11T23:12:50.608Z] requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/models/monai-test/test_bundle/refs
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/bundle/__main__.py", line 31, in <module>
[2024-05-11T23:12:50.608Z]     fire.Fire()
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 143, in Fire
[2024-05-11T23:12:50.608Z]     component_trace = _Fire(component, args, parsed_flag_args, context, name)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 477, in _Fire
[2024-05-11T23:12:50.608Z]     component, remaining_args = _CallAndUpdateTrace(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 693, in _CallAndUpdateTrace
[2024-05-11T23:12:50.608Z]     component = fn(*varargs, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/bundle/scripts.py", line 382, in download
[2024-05-11T23:12:50.608Z]     version_ = _get_latest_bundle_version(source=source_, name=name_, repo=repo_)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/bundle/scripts.py", line 249, in _get_latest_bundle_version
[2024-05-11T23:12:50.608Z]     refs = huggingface_hub.list_repo_refs(repo_id=repo)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
[2024-05-11T23:12:50.608Z]     return fn(*args, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 2874, in list_repo_refs
[2024-05-11T23:12:50.608Z]     hf_raise_for_status(response)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 371, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     raise HfHubHTTPError(str(e), response=response) from e
[2024-05-11T23:12:50.608Z] huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/models/monai-test/test_bundle/refs
[2024-05-11T23:12:50.608Z] ', b"2024-05-11 23:00:00,122 - INFO - --- input summary of monai.bundle.scripts.download ---
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > name: 'test_bundle'
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > bundle_dir: '/tmp/tmpj4nbldaz'
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > source: 'huggingface_hub'
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > repo: 'monai-test/test_bundle'
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > remove_prefix: 'monai_'
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - > progress: False
[2024-05-11T23:12:50.608Z] 2024-05-11 23:00:00,123 - INFO - ---
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] "
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] ======================================================================
[2024-05-11T23:12:50.608Z] ERROR: test_shape_0 (tests.test_transchex.TestTranschex)
[2024-05-11T23:12:50.608Z] ----------------------------------------------------------------------
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 304, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     response.raise_for_status()
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status
[2024-05-11T23:12:50.608Z]     raise HTTPError(http_error_msg, response=self)
[2024-05-11T23:12:50.608Z] requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error
[2024-05-11T23:12:50.608Z]     metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
[2024-05-11T23:12:50.608Z]     return fn(*args, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata
[2024-05-11T23:12:50.608Z]     r = _request_wrapper(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper
[2024-05-11T23:12:50.608Z]     response = _request_wrapper(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 396, in _request_wrapper
[2024-05-11T23:12:50.608Z]     hf_raise_for_status(response)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 371, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     raise HfHubHTTPError(str(e), response=response) from e
[2024-05-11T23:12:50.608Z] huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 398, in cached_file
[2024-05-11T23:12:50.608Z]     resolved_file = hf_hub_download(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
[2024-05-11T23:12:50.608Z]     return fn(*args, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download
[2024-05-11T23:12:50.608Z]     return _hf_hub_download_to_cache_dir(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir
[2024-05-11T23:12:50.608Z]     _raise_on_head_call_error(head_call_error, force_download, local_files_only)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error
[2024-05-11T23:12:50.608Z]     raise LocalEntryNotFoundError(
[2024-05-11T23:12:50.608Z] 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.
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
[2024-05-11T23:12:50.608Z]     return func(*(a + p.args), **p.kwargs, **kw)
[2024-05-11T23:12:50.608Z]   File "/tmp/tmp.vyQ5lTRR71/tests/test_transchex.py", line 53, in test_shape
[2024-05-11T23:12:50.608Z]     net = Transchex(**input_param)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/networks/nets/transchex.py", line 342, in __init__
[2024-05-11T23:12:50.608Z]     self.multimodal = MultiModal.from_pretrained(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/networks/nets/transchex.py", line 68, in from_pretrained
[2024-05-11T23:12:50.608Z]     weights_path = cached_file(path_or_repo_id, filename, cache_dir=cache_dir)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 441, in cached_file
[2024-05-11T23:12:50.608Z]     raise EnvironmentError(
[2024-05-11T23:12:50.608Z] OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like bert-base-uncased is not the path to a directory containing a file named pytorch_model.bin.
[2024-05-11T23:12:50.608Z] Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] ======================================================================
[2024-05-11T23:12:50.608Z] ERROR: test_shape_1 (tests.test_transchex.TestTranschex)
[2024-05-11T23:12:50.608Z] ----------------------------------------------------------------------
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 304, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     response.raise_for_status()
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status
[2024-05-11T23:12:50.608Z]     raise HTTPError(http_error_msg, response=self)
[2024-05-11T23:12:50.608Z] requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error
[2024-05-11T23:12:50.608Z]     metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
[2024-05-11T23:12:50.608Z]     return fn(*args, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata
[2024-05-11T23:12:50.608Z]     r = _request_wrapper(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper
[2024-05-11T23:12:50.608Z]     response = _request_wrapper(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 396, in _request_wrapper
[2024-05-11T23:12:50.608Z]     hf_raise_for_status(response)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 371, in hf_raise_for_status
[2024-05-11T23:12:50.608Z]     raise HfHubHTTPError(str(e), response=response) from e
[2024-05-11T23:12:50.608Z] huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 398, in cached_file
[2024-05-11T23:12:50.608Z]     resolved_file = hf_hub_download(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
[2024-05-11T23:12:50.608Z]     return fn(*args, **kwargs)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download
[2024-05-11T23:12:50.608Z]     return _hf_hub_download_to_cache_dir(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir
[2024-05-11T23:12:50.608Z]     _raise_on_head_call_error(head_call_error, force_download, local_files_only)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error
[2024-05-11T23:12:50.608Z]     raise LocalEntryNotFoundError(
[2024-05-11T23:12:50.608Z] 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.
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] The above exception was the direct cause of the following exception:
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] Traceback (most recent call last):
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
[2024-05-11T23:12:50.608Z]     return func(*(a + p.args), **p.kwargs, **kw)
[2024-05-11T23:12:50.608Z]   File "/tmp/tmp.vyQ5lTRR71/tests/test_transchex.py", line 53, in test_shape
[2024-05-11T23:12:50.608Z]     net = Transchex(**input_param)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/networks/nets/transchex.py", line 342, in __init__
[2024-05-11T23:12:50.608Z]     self.multimodal = MultiModal.from_pretrained(
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/monai/networks/nets/transchex.py", line 68, in from_pretrained
[2024-05-11T23:12:50.608Z]     weights_path = cached_file(path_or_repo_id, filename, cache_dir=cache_dir)
[2024-05-11T23:12:50.608Z]   File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 441, in cached_file
[2024-05-11T23:12:50.608Z]     raise EnvironmentError(
[2024-05-11T23:12:50.608Z] OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like bert-base-uncased is not the path to a directory containing a file named pytorch_model.bin.
[2024-05-11T23:12:50.608Z] Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] ----------------------------------------------------------------------
[2024-05-11T23:12:50.608Z] Ran 14551 tests in 2620.053s
[2024-05-11T23:12:50.608Z] 
[2024-05-11T23:12:50.608Z] FAILED (errors=3, skipped=490)
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue May 13, 2024
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
KumoLiu added a commit that referenced this issue May 13, 2024
Fixes #7764

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant