A newer version of the Gradio SDK is available:
4.37.2
@gradio/client
0.19.3
Features
Fixes
- #8296
929d216
- always create a jwt when connecting to a space if a hf_token is present. Thanks @pngwn!
0.19.2
Fixes
0.19.1
Fixes
0.19.0
Features
- #8110
5436031
- Render decorator 2. Thanks @aliabid94! - #8197
e09b4e8
- Add support for passing keyword args todata
in JS client. Thanks @hannahblair!
Fixes
0.18.0
Features
- #8121
f5b710c
- chore(deps): update dependency eslint to v9. Thanks @renovate! - #8209
b9afe93
- RenameeventSource_Factory
andfetch_implementation
. Thanks @hannahblair! - #8109
bed2f82
- Implement JS Client tests. Thanks @hannahblair! - #8211
91b5cd6
- remove redundant event source logic. Thanks @hannahblair!
Fixes
- #8179
6a218b4
- rework upload to be a class method + pass client into each component. Thanks @pngwn! - #8181
cf52ca6
- Ensure connectivity to private HF spaces with SSE protocol. Thanks @hannahblair! - #8169
3a6f1a5
- Only connect to heartbeat if needed. Thanks @freddyaboulton! - #8118
7aca673
- Add eventsource polyfill for Node.js and browser environments. Thanks @hannahblair!
0.17.0
Highlights
Setting File Upload Limits (#7909 2afca65
)
We have added a max_file_size
size parameter to launch()
that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).
The following code snippet sets a max file size of 5 megabytes.
import gradio as gr
demo = gr.Interface(lambda x: x, "image", "image")
demo.launch(max_file_size="5mb")
# or
demo.launch(max_file_size=5 * gr.FileSize.MB)
Error states can now be cleared
When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the x
icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.
Thanks @freddyaboulton!
Features
- #8056
2e469a5
- Using keys to preserve values between reloads. Thanks @aliabid94! - #7646
450b8cc
- Refactor JS Client. Thanks @hannahblair! - #8061
17e83c9
- Docs Reorg and Intro Page. Thanks @aliabd!
Fixes
0.16.0
Features
Fixes
0.15.1
Fixes
0.15.0
Highlights
Automatically delete state after user has disconnected from the webpage (#7829 6a4bf7a
)
Gradio now automatically deletes gr.State
variables stored in the server's RAM when users close their browser tab.
The deletion will happen 60 minutes after the server detected a disconnect from the user's browser.
If the user connects again in that timeframe, their state will not be deleted.
Additionally, Gradio now includes a Blocks.unload()
event, allowing you to run arbitrary cleanup functions when users disconnect (this does not have a 60 minute delay).
You can think of the unload
event as the opposite of the load
event.
with gr.Blocks() as demo:
gr.Markdown(
"""# State Cleanup Demo
🖼️ Images are saved in a user-specific directory and deleted when the users closes the page via demo.unload.
""")
with gr.Row():
with gr.Column(scale=1):
with gr.Row():
img = gr.Image(label="Generated Image", height=300, width=300)
with gr.Row():
gen = gr.Button(value="Generate")
with gr.Row():
history = gr.Gallery(label="Previous Generations", height=500, columns=10)
state = gr.State(value=[], delete_callback=lambda v: print("STATE DELETED"))
demo.load(generate_random_img, [state], [img, state, history])
gen.click(generate_random_img, [state], [img, state, history])
demo.unload(delete_directory)
demo.launch(auth=lambda user,pwd: True,
auth_message="Enter any username and password to continue")
Thanks @freddyaboulton!
0.14.0
Features
Fixes
0.13.0
Fixes
- #7575
d0688b3
- Files should now be supplied asfile(...)
in the Client, and some fixes togr.load()
as well. Thanks @abidlabs!
0.12.2
Features
- #7528
eda33b3
- Refactorsget_fetchable_url_or_file()
to remove it from the frontend. Thanks @abidlabs! - #7340
4b0d589
- chore(deps): update all non-major dependencies. Thanks @renovate!
0.12.1
Fixes
- #7411
32b317f
- Setroot
correctly for Gradio apps that are deployed behind reverse proxies. Thanks @abidlabs!
0.12.0
Features
- #7183
49d9c48
- [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks @abidlabs!
0.11.0
Features
- #7102
68a54a7
- Improve chatbot streaming performance with diffs. Thanks @aliabid94!/n Note that this PR changes the API format for generator functions, which would be a breaking change for any clients reading the EventStream directly
0.10.1
Fixes
- #7055
3c3cf86
- Fix UI freeze on rapid generators. Thanks @aliabid94!
0.10.0
Features
- #6931
6c863af
- Fix functional tests. Thanks @aliabid94! - #6820
649cd4d
- UseEventSource_factory
inopen_stream()
for Wasm. Thanks @whitphx!
0.9.4
Fixes
- #6863
d406855
- Fix JS Client when app is running behind a proxy. Thanks @freddyaboulton!
0.9.3
Features
- #6814
828fb9e
- Refactor queue so that there are separate queues for each concurrency id. Thanks @aliabid94!
0.9.2
Features
- #6798
245d58e
- Improve how server/js client handle unexpected errors. Thanks @freddyaboulton!
0.9.1
Fixes
- #6693
34f9431
- Python client properly handles hearbeat and log messages. Also handles responses longer than 65k. Thanks @freddyaboulton!
0.9.0
Features
Fixes
- #6556
d76bcaa
- Fix api event drops. Thanks @aliabid94!
0.8.2
Features
- #6511
71f1a1f99
- MarkFileData.orig_name
optional on the frontend aligning the type definition on the Python side. Thanks @whitphx!
0.8.1
Fixes
- #6383
324867f63
- Fix event target. Thanks @aliabid94!
0.8.0
Features
- #6307
f1409f95e
- Provide status updates on file uploads. Thanks @freddyaboulton!
0.7.2
Fixes
- #6327
bca6c2c80
- Restore query parameters in request. Thanks @aliabid94!
0.7.1
Features
- #6137
2ba14b284
- JS Param. Thanks @dawoodkhan82!
0.7.0
Features
- #5498
287fe6782
- fix circular dependency with client + upload. Thanks @pngwn! - #5498
287fe6782
- Image v4. Thanks @pngwn! - #5498
287fe6782
- Swap websockets for SSE. Thanks @pngwn!
0.7.0-beta.1
Features
- #6143
e4f7b4b40
- fix circular dependency with client + upload. Thanks @pngwn! - #6094
c476bd5a5
- Image v4. Thanks @pngwn! - #6069
bf127e124
- Swap websockets for SSE. Thanks @aliabid94!
0.7.0-beta.0
Features
- #6016
83e947676
- Format js in v4 branch. Thanks @freddyaboulton!
Fixes
0.6.0
Features
- #5972
11a300791
- Lite: Support opening the entrypoint HTML page directly in browser via thefile:
protocol. Thanks @whitphx!
0.5.2
Fixes
- #5840
4e62b8493
- Ensure websocket polyfill doesn't load if there is already aglobal.Webocket
property set. Thanks @Jay2theWhy!
0.5.1
Fixes
- #5816
796145e2c
- Fix calls to the component server so thatgr.FileExplorer
works on Spaces. Thanks @abidlabs!
0.5.0
Highlights
new FileExplorer
component (#5672 e4a307ed6
)
Thanks to a new capability that allows components to communicate directly with the server without passing data via the value, we have created a new FileExplorer
component.
This component allows you to populate the explorer by passing a glob, but only provides the selected file(s) in your prediction function.
Users can then navigate the virtual filesystem and select files which will be accessible in your predict function. This component will allow developers to build more complex spaces, with more flexible input options.
For more information check the FileExplorer
documentation.
Thanks @aliabid94!
Features
- #5787
caeee8bf7
- ensure the client does not depend onwindow
when running in a node environment. Thanks @gibiee!
Fixes
- #5776
c0fef4454
- Revert replica proxy logic and instead implement using theroot
variable. Thanks @freddyaboulton!
0.4.2
Features
0.4.1
Fixes
- #5705
78e7cf516
- ensure internal data has updated before dispatchingsuccess
orthen
events. Thanks @pngwn!
0.4.0
Features
- #5682
c57f1b75e
- Fix functional tests. Thanks @abidlabs! - #5681
40de3d217
- add query parameters to thegr.Request
object through thequery_params
attribute. Thanks @DarhkVoyd! - #5653
ea0e00b20
- Prevent Clients from accessing API endpoints that setapi_name=False
. Thanks @abidlabs!
0.3.1
Fixes
- #5412
26fef8c7
- Skip view_api request in js client when auth enabled. Thanks @freddyaboulton!
0.3.0
Features
- #5267
119c8343
- Faster reload mode. Thanks @freddyaboulton!
0.2.1
Features
- #5173
730f0c1d
- Ensure gradio client works as expected for functions that return nothing. Thanks @raymondtri!
0.2.0
Features
- #5133
61129052
- Update dependency esbuild to ^0.19.0. Thanks @renovate! - #5035
8b4eb8ca
- JS Client: Fixes cannot read properties of null (reading 'is_file'). Thanks @raymondtri!
Fixes
0.1.4
Patch Changes
0.1.3
Patch Changes
0.1.2
Patch Changes
#4273
1d0f0a9d
Thanks @pngwn! - Ensure websocket error messages are correctly handled.#4271
1151c525
Thanks @pngwn! - Ensure the full root path is always respected when making requests to a gradio app server.
0.1.1
Patch Changes
#4201
da5b4ee1
Thanks @pngwn! - Ensure semiver is bundled so CDN links work correctly.#4202
a26e9afd
Thanks @pngwn! - Ensure all URLs returned by the client are complete URLs with the correct host instead of an absolute path relative to a server.