From 89d11a5ab3897d9c79b9b33f2e16499f87769779 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Sat, 11 May 2024 00:10:04 -0400 Subject: [PATCH 1/5] reduce analytics --- gradio/analytics.py | 1 - gradio/blocks.py | 4 ---- .../01_getting-started/03_sharing-your-app.md | 15 +++++++++++++++ js/app/src/Blocks.svelte | 17 ----------------- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/gradio/analytics.py b/gradio/analytics.py index d5c66abc8a039..661b1b2d26599 100644 --- a/gradio/analytics.py +++ b/gradio/analytics.py @@ -234,7 +234,6 @@ def get_inputs_outputs( "dev_mode": blocks.dev_mode, "show_api": blocks.show_api, "show_error": blocks.show_error, - "title": blocks.title, "inputs": get_inputs_outputs( blocks.mode, blocks.input_components, inputs_telemetry ), diff --git a/gradio/blocks.py b/gradio/blocks.py index 3001e8dfb8a8a..ebdf024237c92 100644 --- a/gradio/blocks.py +++ b/gradio/blocks.py @@ -2479,10 +2479,6 @@ def reverse(text): "launch_method": "browser" if inbrowser else "inline", "is_google_colab": self.is_colab, "is_sharing_on": self.share, - "share_url": self.share_url, - "enable_queue": True, - "server_name": server_name, - "server_port": server_port, "is_space": self.space_id is not None, "mode": self.mode, } diff --git a/guides/01_getting-started/03_sharing-your-app.md b/guides/01_getting-started/03_sharing-your-app.md index d2f6bf70df29e..cd93bdbe563fb 100644 --- a/guides/01_getting-started/03_sharing-your-app.md +++ b/guides/01_getting-started/03_sharing-your-app.md @@ -10,6 +10,7 @@ How to share your Gradio app: 6. [Mounting within FastAPI](#mounting-within-another-fast-api-app) 7. [Authentication](#authentication) 8. [Security and file access](#security-and-file-access) +9. [Analytics](#analytics) ## Sharing Demos @@ -464,3 +465,17 @@ demo.launch(max_file_size=5 * gr.FileSize.MB) ``` Please make sure you are running the latest version of `gradio` for these security settings to apply. + +## Analytics + +By default, Gradio collects certain analytics to help us better understand the usage of the `gradio` library. This includes the following information: + +* What environment the Gradio app is running on (e.g. Colab Notebook, Hugging Face Spaces) +* What input/output components are being used in the Gradio app +* Whether the Gradio app is utilizing certain advanced features, such as `auth` or `show_error` +* The IP address which is used solely to measure the number of unique developers using Gradio +* The version of Gradio that is running + +No information is collected from _users_ of your Gradio app. If you'd like to diable analytics altogether, you can do so by setting the `analytics_enabled` parameter to `False` in `gr.Blocks`, `gr.Interface`, or `gr.ChatInterface`. Or, you can set the GRADIO_ANALYTICS_ENABLED environment variable to `"False"` to apply this to all Gradio apps created across your system. + +*Note*: this reflects the analytics policy as of `gradio>=4.32.0`. diff --git a/js/app/src/Blocks.svelte b/js/app/src/Blocks.svelte index e2086f3b41fad..658505c5665a1 100644 --- a/js/app/src/Blocks.svelte +++ b/js/app/src/Blocks.svelte @@ -540,23 +540,6 @@ {#if control_page_title} {title} {/if} - {#if analytics_enabled} - - - {/if}
From 40452bc241a3478c016af8c8765523aee6af6b88 Mon Sep 17 00:00:00 2001 From: gradio-pr-bot Date: Sat, 11 May 2024 05:28:33 +0000 Subject: [PATCH 2/5] add changeset --- .changeset/shaggy-tables-fly.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/shaggy-tables-fly.md diff --git a/.changeset/shaggy-tables-fly.md b/.changeset/shaggy-tables-fly.md new file mode 100644 index 0000000000000..6aa5639b0453a --- /dev/null +++ b/.changeset/shaggy-tables-fly.md @@ -0,0 +1,6 @@ +--- +"@gradio/app": minor +"gradio": minor +--- + +feat:Reduce the analytics that are collected in Gradio From cf243afa2da0ed8e69f0290b56f26a760dc5e429 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Mon, 13 May 2024 12:10:59 -0700 Subject: [PATCH 3/5] mark flaky --- client/python/test/test_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/python/test/test_client.py b/client/python/test/test_client.py index f321fb319cac1..6796751d27307 100644 --- a/client/python/test/test_client.py +++ b/client/python/test/test_client.py @@ -324,6 +324,7 @@ def test_upload_and_download_with_auth(self): with open(output) as f: assert f.read() == "Hello file!" + @pytest.mark.flaky def test_cancel_from_client_queued(self, cancel_from_client_demo): with connect(cancel_from_client_demo) as client: start = time.time() From 0fbf29af5334d7de9f876fc4660352bc133a468d Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Mon, 13 May 2024 12:14:17 -0700 Subject: [PATCH 4/5] lint --- js/app/src/Blocks.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/js/app/src/Blocks.svelte b/js/app/src/Blocks.svelte index 658505c5665a1..26b035736a565 100644 --- a/js/app/src/Blocks.svelte +++ b/js/app/src/Blocks.svelte @@ -27,7 +27,6 @@ export let layout: LayoutNode; export let dependencies: Dependency[]; export let title = "Gradio"; - export let analytics_enabled = false; export let target: HTMLElement; export let autoscroll: boolean; export let show_api = true; From 840b6bef9cd79a01d3e0ab887f0c3e6ae3379d5c Mon Sep 17 00:00:00 2001 From: gradio-pr-bot Date: Mon, 13 May 2024 22:57:31 +0000 Subject: [PATCH 5/5] add changeset --- .changeset/shaggy-tables-fly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/shaggy-tables-fly.md b/.changeset/shaggy-tables-fly.md index 6aa5639b0453a..7282500756a5f 100644 --- a/.changeset/shaggy-tables-fly.md +++ b/.changeset/shaggy-tables-fly.md @@ -1,6 +1,6 @@ --- -"@gradio/app": minor -"gradio": minor +"@gradio/app": patch +"gradio": patch --- feat:Reduce the analytics that are collected in Gradio