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

Avoid ImportError when importing WebhooksServer and Gradio is not installed #1482

Merged
merged 2 commits into from
May 22, 2023

Conversation

mariosasko
Copy link
Contributor

@mariosasko mariosasko commented May 22, 2023

Avoids the ImportError when doing from huggingface_hub import * without having Gradio installed.

(The error is now raised when initializing a WebhooksServer object.)

@mariosasko mariosasko changed the title Avoid ImportError when importing WebhooksServer and Gradio is not installed Avoid ImportError when importing WebhooksServer and Gradio is not installed May 22, 2023
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 22, 2023

The documentation is not available anymore as the PR was closed or merged.

@mariosasko mariosasko requested a review from Wauplin May 22, 2023 17:03
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for the PR. Feel free to merge it when the CI is green :)

Out of curiosity, are you using this feature? What's the use case?

@mariosasko
Copy link
Contributor Author

mariosasko commented May 22, 2023

@Wauplin No, but I use from huggingface_hub import * for debugging (in the REPL) 🙂.

@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Patch coverage: 70.00% and project coverage change: -0.02 ⚠️

Comparison is base (b3e21ec) 82.44% compared to head (9c5c958) 82.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1482      +/-   ##
==========================================
- Coverage   82.44%   82.42%   -0.02%     
==========================================
  Files          53       53              
  Lines        5707     5708       +1     
==========================================
  Hits         4705     4705              
- Misses       1002     1003       +1     
Impacted Files Coverage Δ
src/huggingface_hub/_webhooks_server.py 72.54% <66.66%> (-0.93%) ⬇️
src/huggingface_hub/_webhooks_payload.py 100.00% <100.00%> (+1.72%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mariosasko mariosasko merged commit a77cda6 into main May 22, 2023
@mariosasko mariosasko deleted the avoid-gradio-importerror branch May 22, 2023 17:25
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 this pull request may close these issues.

3 participants