-
Notifications
You must be signed in to change notification settings - Fork 608
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
504 Server Error: Gateway Time-out #2460
Comments
Hi @dgks0n, thanks for reporting and sorry for the inconvenience. I have been able to reproduce the issue with this code snippet: from huggingface_hub import list_models
count = 0
for model in list_models(
filter=["text-classification", "pytorch", "transformers"],
sort='downloads',
):
count += 1
print(count, model.id, model.downloads) Fails after 36000 has been printed. Since there are ~36234 models matching the filter on the Hub, I suspect it has to do with the last page. If I limit to 10 or 1234, it works fine. I'll report it to the Hub team and let you know. EDIT: if fails only if |
@Wauplin Thanks for your response~ Another one is, it seems almost of models don't have |
To return the As a matter of fact, it's recommended to use |
To do what @Pierrci suggested above with the Python client, you can pass like this: from huggingface_hub import list_models
for model in list_models(
filter=...,
sort=...,
...
expand=["config", "siblings"],
):
... Only the selected fields will be populated in the returned |
@Wauplin Is it possible to use |
@dangokuson no, that's not possible as far as I know. |
@Wauplin You mean it only supports sorting by single field such as |
Yes exactly. from huggingface_hub import list_models
print("Top 5 models by downloads:")
for model in list_models(sort="downloads", limit=5):
print(model.id, model.lastModified, model.downloads)
print("\nTop 5 models by last modified:")
for model in list_models(sort="last_modified", limit=5):
print(model.id, model.lastModified, model.downloads) =>
|
@Wauplin I used as below but it returned empty list.
Is there something wrong? |
@dgks0n are you sure? I just ran from huggingface_hub import list_models
for model in list_models(
filter=['text-classification','pytorch', 'transformers'],
sort='downloads',
expand=["config", "siblings"],
limit=5,
):
print(model.id, model.downloads) and got
using |
@Wauplin Thanks. It works~ |
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.Logs
No response
System info
The text was updated successfully, but these errors were encountered: