Disable telemetry when DISABLE_TELEMETRY is set (#1686)

fixed #1685 - disables telemetry when DISABLE_TELEMETRY and HF_HUB_OFFLINE is set
This commit is contained in:
w4ffl35 2022-12-13 08:28:07 -07:00 committed by GitHub
parent e01d6cf295
commit 07f95503e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ def send_telemetry(data: Dict, name: str):
name: a unique name to differentiate the telemetry logs, e.g. "diffusers_examples" or "diffusers_notebooks"
"""
if DISABLE_TELEMETRY or HF_HUB_OFFLINE:
pass
return
headers = {"user-agent": http_user_agent(data)}
endpoint = HUGGINGFACE_CO_TELEMETRY + name