-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add Analytics for custom components #8130
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/7b511c1234d5b91b268f3ff59c97d09daaefc449/gradio-4.27.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@7b511c1234d5b91b268f3ff59c97d09daaefc449#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
] | ||
outputs_telemetry = outputs_telemetry + [ | ||
str(blocks.blocks[y]) for y in x.outputs if y in blocks.blocks | ||
blocks.blocks[y].get_block_name() for y in x.outputs if y in blocks.blocks |
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.
does get_block_name
return a string different from before? If so, when comparing analytics this could break things
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.
Before we were doing the wrong thing imo. We were storing the full class path <gradio.components.textbox.Textbox object at 0x11c035790>
.
Change introduced in this PR: #7712 probably
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.
This fix makes sense. We'll probably have to update the kibana dashboard for how we filter input/output components
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.
Yes my bad about that change. This is the better approach and reverts back to just storing the string names (so we shouldn't have to make changes to Kibana)
x, BlockContext | ||
) else blocks_telemetry.append(str(x)) | ||
|
||
blocks_telemetry.append(x.get_block_name()) |
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.
We were saving the string repr of the instance as opposed to the name, e.g. <gradio.components.textbox.Textbox object at 0x11c035790>
gradio/analytics.py
Outdated
def custom_component_analytics( | ||
command: str, | ||
template: str | None, | ||
upload_pypi: bool | None, | ||
upload_demo: bool | None, | ||
upload_source: bool | None, | ||
generate_docs: bool | None = None, | ||
bump_version: bool | None = None, | ||
) -> None: |
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.
Do you think it would be worth capturing the arguments being used (as a list) but maybe not the value. Then we could see if people are customising extensively or not?
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.
look great. Thanks @freddyaboulton! This will be super useful.
Just left a small question.
Everything looks good to me @freddyaboulton! Just about to review the companion PR on the server |
e53f5e2
to
14f146b
Compare
Description
Closes: #7330
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh