I am trying to spacerunner with help of
autotrain spacerunner --project-name demo5
INFO | 2025-01-17 15:27:03 | autotrain.trainers.generic.utils:create_dataset_repo:23 - Creating dataset repo…
INFO | 2025-01-17 15:27:04 | autotrain.trainers.generic.utils:create_dataset_repo:31 - Uploading dataset…
While pushing, it gives HTTP error :504
huggingface_hub.errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/jungrok/autotrain-demo5/commit/main
What is the solution?
1 Like
It’s more likely to happen when the load is high, but uploading a model shouldn’t be that heavy, so I wonder if the server is acting up…
It’s possible to avoid this by saving the pretrained model with ‘save_pretrained’ instead of ‘push_to_hub’ and uploading it with git, etc., but you might need to raise an issue on github to get it resolved.
opened 02:40PM - 19 Aug 24 UTC
closed 02:42PM - 21 Aug 24 UTC
bug
### Describe the bug
huggingface_hub.utils._errors.HfHubHTTPError: 504 Server… Error: Gateway Time-out for url: https://huggingface.co/api/models?filter=text-classification&filter=pytorch&filter=transformers&sort=downloads&direction=-1&config=True&cursor=eyIkb3IiOlt7ImRvd25sb2FkcyI6MiwiX2lkIjp7IiRndCI6IjYzOTBkOWYzM2RlNzZkNjAyOTlhY2JlMCJ9fSx7ImRvd25sb2FkcyI6eyIkbHQiOjJ9fSx7ImRvd25sb2FkcyI6bnVsbH1dfQ%3D%3D
How to solve this?
### Reproduction
I installed the latest version of `huggingface_hub` but I faced 504 Gateway Timeout error.
```
_huggingface_api = HfApi()
def get_models() -> dict:
pipeline_tag = 'text-classification'
applied_tags = {
'pipelineTags': [pipeline_tag],
'libraries': ['pytorch', 'transformers'],
}
# TODO: Fix bug 504 Gateway Timeout
models = _huggingface_api.list_models(
filter=[tags for tags_list in applied_tags.values() for tags in tags_list],
sort='downloads',
direction=-1,
fetch_config=True
)
models = [_convert_hf_model_info(model) for model in models if model.pipeline_tag == pipeline_tag]
...
```
### Logs
_No response_
### System info
```shell
- huggingface_hub version: 0.25.0.dev0
- Platform: Linux-6.8.0-40-generic-x86_64-with-glibc2.35
- Python version: 3.9.19
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/dummy/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.13.1
- Jinja2: 3.1.2
- Graphviz: N/A
- keras: N/A
- Pydot: N/A
- Pillow: 10.3.0
- hf_transfer: N/A
- gradio: N/A
- tensorboard: 2.6.2.2
- numpy: 1.22.0
- pydantic: 2.8.2
- aiohttp: 3.10.3
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /home/dummy/.cache/huggingface/hub
- HF_ASSETS_CACHE: /home/dummy/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/dummy/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
{'huggingface_hub version': '0.25.0.dev0', 'Platform': 'Linux-6.8.0-40-generic-x86_64-with-glibc2.35', 'Python version': '3.9.19', 'Running in iPython ?': 'No', 'Running in notebook ?': 'No', 'Running in Google Colab ?': 'No', 'Token path ?': '/home/dummy/.cache/huggingface/token', 'Has saved token ?': False, 'Configured git credential helpers': '', 'FastAI': 'N/A', 'Tensorflow': 'N/A', 'Torch': '1.13.1', 'Jinja2': '3.1.2', 'Graphviz': 'N/A', 'keras': 'N/A', 'Pydot': 'N/A', 'Pillow': '10.3.0', 'hf_transfer': 'N/A', 'gradio': 'N/A', 'tensorboard': '2.6.2.2', 'numpy': '1.22.0', 'pydantic': '2.8.2', 'aiohttp': '3.10.3', 'ENDPOINT': 'https://huggingface.co', 'HF_HUB_CACHE': '/home/dummy/.cache/huggingface/hub', 'HF_ASSETS_CACHE': '/home/dummy/.cache/huggingface/assets', 'HF_TOKEN_PATH': '/home/dummy/.cache/huggingface/token', 'HF_HUB_OFFLINE': False, 'HF_HUB_DISABLE_TELEMETRY': False, 'HF_HUB_DISABLE_PROGRESS_BARS': None, 'HF_HUB_DISABLE_SYMLINKS_WARNING': False, 'HF_HUB_DISABLE_EXPERIMENTAL_WARNING': False, 'HF_HUB_DISABLE_IMPLICIT_TOKEN': False, 'HF_HUB_ENABLE_HF_TRANSFER': False, 'HF_HUB_ETAG_TIMEOUT': 10, 'HF_HUB_DOWNLOAD_TIMEOUT': 10}
```