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

Disable Gradio Analytics #1165

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

lopagela
Copy link
Contributor

@lopagela lopagela commented Nov 5, 2023

Gradio analytics can be disabled by either using the kwargs enable_analytics on gr.Blocks, or by setting the env variable GRADIO_ANALYTICS_ENABLED to something different from True.

Since that Gradio does not seem to respect their code contract (around enable_analytics), and that they are performing other operations only based on the value of GRADIO_ANALYTICS_ENABLED (c.f. gradio.strings https://github.com/gradio-app/gradio/blob/main/gradio/strings.py#L39), we are disabling gradio analytics by setting the required env variable to False.

Note: Setting an environment variables using os.environ['foo'] = 'bar' on system that are not based on unix might not work.

c.f. https://docs.python.org/3/library/os.html#os.environ for details on how os.environ works and all its caveats

See #1144 for the similar PR on chromaDB telemetry (that motivated this PR)

Gradio analytics can be disabled by either using the kwargs `enable_analytics` on `gr.Blocks`, or by setting the env variable `GRADIO_ANALYTICS_ENABLED` to something different from `True`.

Since that Gradio does not seem to respect their code contract (around `enable_analytics`), and that they are performing other operations only based on the value of `GRADIO_ANALYTICS_ENABLED` (c.f. `gradio.strings` https://github.com/gradio-app/gradio/blob/main/gradio/strings.py#L39), we are disabling gradio analytics by setting the required env variable to `False`.

Note: Setting an environment variables using `os.environ['foo'] = 'bar'` on system that are not based on unix might not work.

c.f. https://docs.python.org/3/library/os.html#os.environ for details on how `os.environ` works and all its caveats
@lopagela
Copy link
Contributor Author

lopagela commented Nov 5, 2023

After this change, there will be absolutely no HTTP call made to gradio API, cleaning the DEBUG log, and preserving anonymity of users

imartinez
imartinez previously approved these changes Nov 6, 2023
private_gpt/__init__.py Outdated Show resolved Hide resolved
@pabloogc pabloogc merged commit 6583dc8 into zylon-ai:main Nov 6, 2023
6 checks passed
@lopagela lopagela deleted the fully-disable-gradio-analytics branch November 6, 2023 14:07
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