Closed freddyaboulton closed 3 months ago
• | Name | Status | URL |
---|---|---|---|
Spaces | ready! | Spaces preview | |
Website | ready! | Website preview | |
:unicorn: | Changes | detecting... |
Install Gradio from this PR
pip install https://gradio-builds.s3.amazonaws.com/1c535500afa038b9170e18d9e806883323b7b2ba/gradio-4.32.2-py3-none-any.whl
Install Gradio Python Client from this PR
pip install "gradio-client @ git+https://github.com/gradio-app/gradio@1c535500afa038b9170e18d9e806883323b7b2ba#subdirectory=client/python"
Install Gradio JS Client from this PR
npm install https://gradio-builds.s3.amazonaws.com/1c535500afa038b9170e18d9e806883323b7b2ba/gradio-client-0.20.1.tgz
Package | Version |
---|---|
gradio |
patch |
Fix type hints for render and on
Maintainers or the PR author can modify the PR title to modify this entry.
Thanks for the reviews everyone!
Description
I noticed two things that were off about the type hints for on and render
Any
for the triggers ofgr.on
. Which was too broad.render
, the triggers were not typed correctly so passing a valid trigger, e.g.slider.change
would be flagged in vs code.render
, the type hint did not allow for a single component to be passed as input, but it is allowed.Main
PR Invalid value for
triggers
ofgr.on
is flaggedPassing an event listener method for
render
is not flagged🎯 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