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

Add comment to _send_telemetry_in_thread explaining it should not be removed #2264

Merged
merged 3 commits into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/huggingface_hub/utils/_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@ def _send_telemetry_in_thread(
library_version: Optional[str] = None,
user_agent: Union[Dict, str, None] = None,
) -> None:
"""Contains the actual data sending data to the Hub."""
"""Contains the actual data sending data to the Hub.

This function is called directly in gradio's analytics because
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it gradio's analytics or only gradio lite? Can you also add a link to the
Gradio issue as a comment? Thanks a lot!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's gradio's !

it is not possible to send telemetry from a daemon thread.

See here: https://github.com/gradio-app/gradio/pull/8180

Please do not rename or remove this function.
"""
path = "/".join(quote(part) for part in topic.split("/") if len(part) > 0)
try:
r = get_session().head(
Expand Down
Loading