-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Lite: Disable the analytics function forcefully in the Wasm mode #4967
Changes from all commits
18f737d
02e08f4
d050098
8d84676
a8409d3
d4e0e4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@gradio/lite": patch | ||
--- | ||
|
||
Disable the analytics function that doesn't work in the Wasm mode |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -720,6 +720,11 @@ def __init__( | |||||||||||||||
if analytics_enabled is not None | ||||||||||||||||
else analytics.analytics_enabled() | ||||||||||||||||
) | ||||||||||||||||
if wasm_utils.IS_WASM and self.analytics_enabled: | ||||||||||||||||
self.analytics_enabled = False | ||||||||||||||||
warnings.warn( | ||||||||||||||||
abidlabs marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
"Analytics are not supported in the Wasm mode." | ||||||||||||||||
) | ||||||||||||||||
Comment on lines
+723
to
+727
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That being said, it would be nice to know how much usage There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That may be right, but the reason I disabled the analytics now is that the analytics feature does not work on Pyodide because it uses the
Yes. Also, the CDN jsDelivr should also provides such stats, while its page is not found somehow (I don't know why... maybe because the downloads are still few? For exmaple, my
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I thought disabling the analytics is the simplest solution to make It would be fixing the code depending on the What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This would be great! I do think analytics capturing the usage would be very valuable. We don't have to add them in this PR, but would be good to have before launch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created another PR doing it: #5045 However let me ask one question: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My another concern is whether it is legally clear (sorry I'm not a legal expert though). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, thanks! |
||||||||||||||||
if self.analytics_enabled: | ||||||||||||||||
t = threading.Thread(target=analytics.version_check) | ||||||||||||||||
t.start() | ||||||||||||||||
|
@@ -761,7 +766,7 @@ def __init__( | |||||||||||||||
self.root_path = "" | ||||||||||||||||
self.root_urls = set() | ||||||||||||||||
|
||||||||||||||||
if not wasm_utils.IS_WASM and self.analytics_enabled: | ||||||||||||||||
if self.analytics_enabled: | ||||||||||||||||
is_custom_theme = not any( | ||||||||||||||||
self.theme.to_dict() == built_in_theme.to_dict() | ||||||||||||||||
for built_in_theme in BUILT_IN_THEMES.values() | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why two changeset files were created. Maybe because the PR was renamed? But you can probably just delete both of them to reset the action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is a mistake. Will delete one.