Skip to content

Commit

Permalink
Add comment to _send_telemetry_in_thread explaining it should not be …
Browse files Browse the repository at this point in the history
…removed (#2264)

* Add comment

* Add code

* lint
  • Loading branch information
freddyaboulton authored May 3, 2024
1 parent 146d57d commit 2a98fb5
Showing 1 changed file with 9 additions and 1 deletion.
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
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

0 comments on commit 2a98fb5

Please sign in to comment.