NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1673 most downloaded on PyPI
Python library for easily interacting with trained machine learning models
Last release 2 days ago
02 Oct 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 58 of the last 60 stable releases
11 versions withdrawn
withdrawn after publishing
8 years old
679 releases · first in 2019
### Features - #6842 `846d52d` - Fix md highlight. Thanks @pngwn! - #6831 `f3abde8` - Add an option to enable header links for markdown. Thanks @pngwn
846d52d - Fix md highlight. Thanks @pngwn!f3abde8 - Add an option to enable header links for markdown. Thanks @pngwn!828fb9e - Refactor queue so that there are separate queues for each concurrency id. Thanks @aliabid94!1401d99 - Fix ImageEditor interaction story. Thanks @hannahblair!77c9003 - Fixes issue 5781: Enables specifying a caching directory for Examples. Thanks @cswamy!67a2b7f - Fixed duplicate word ("this this"). Thanks @Cassini-chris!1b9d423 - Prevent file traversals. Thanks @abidlabs!50496f9 - Adjust rounding logic when precision is None in gr.Number(). Thanks @hannahblair!73268ee - Improve source selection UX. Thanks @hannahblair!One column per quarter.
### Features - #6798 `245d58e` - Improve how server/js client handle unexpected errors. Thanks @freddyaboulton! - #6794 `7ba8c5d` - Fix SSRF vulnerabi
245d58e - Improve how server/js client handle unexpected errors. Thanks @freddyaboulton!7ba8c5d - Fix SSRF vulnerability on /file= route. Thanks @abidlabs!c352811 - Adds docstrings for gr.WaveformOptions, gr.Brush, and gr.Eraser, fixes examples for ImageEditor, and allows individual images to be used as the initial value for ImageEditor. Thanks @abidlabs!6b130e2 - Ensure LoginButton value text is displayed. Thanks @hannahblair!526fb6c - Fix gr.load() so that it works with the SSE v1 protocol. Thanks @abidlabs!### Features - #6781 `a807ede` - Fix backend tests on Windows. Thanks @abidlabs! ### Fixes - #6525 `5d51fbc` - Fixes Drag and Drop for Upload. Thanks
5d51fbc - Fixes Drag and Drop for Upload. Thanks @dawoodkhan82!51e241a - Fix flaky CI tests (again 😓 ). Thanks @freddyaboulton!34f9431 - Python client properly handles hearbeat and log messages. Also handles responses longer than 65k. Thanks @freddyaboulton!### Features - #6726 `21cfb0a` - Remove the styles from the Image/Video primitive components and Fix the container styles. Thanks @whitphx! - #6398 `6
21cfb0a - Remove the styles from the Image/Video primitive components and Fix the container styles. Thanks @whitphx!67ddd40 - Lite v4. Thanks @whitphx!053bec9 - Improve CSS token documentation in Storybook. Thanks @hannahblair!3240d04 - Add editable parameter to Audio. Thanks @hannahblair!9a0bd27 - Add support for OAuth tokens. Thanks @Wauplin!f3c4d78 - reload on css changes + fix css specificity. Thanks @pngwn!299f5e2 - Update HF token used in CI tests. Thanks @abidlabs!cfd5700 - Cause gr.ClearButton to reset the value of gr.State. Thanks @abidlabs!6b1401c - chore(deps): update dependency marked to v11. Thanks @renovate!30c9fbb - Set gradio api server from env. Thanks @aisensiy!51b54b3 - Tweak to our bug issue template. Thanks @abidlabs!7cbf96e - Issue 5245: consolidate usage of requests and httpx. Thanks @cswamy!24e0481 - Hotfix: update huggingface_hub dependency version. Thanks @abidlabs!bdf81fe - Lite: Set the home dir path per appId at each runtime. Thanks @whitphx!4d1cbbc - Allow passing height and width as string in Blocks.svelte. Thanks @hannahblair!5177132 - Lite: Fix the isMessagePort() type guard in js/wasm/src/worker-proxy.ts. Thanks @whitphx!8a70e83 - switch from black to ruff formatter. Thanks @DarhkVoyd!6a9151d - Remove progress animation on streaming. Thanks @aliabid94!5238053 - Fix reload mode warning about not being able to find the app. Thanks @freddyaboulton!1234c37 - use gr.Error for audio length errors. Thanks @abidlabs!fe40308 - Rotate Images to Upright Position in preprocess. Thanks @freddyaboulton!9a5811d - Fix the download button of the gr.Gallery() component to work. Thanks @whitphx!c9673ca - Fix directory-only glob for FileExplorer. Thanks @freddyaboulton!9a6ff70 - Fix issue with head param when adding more than one script tag. Thanks @dawoodkhan82!d76bcaa - Fix api event drops. Thanks @aliabid94!a1b966e - Fixed an issue where files could not be filed. Thanks @duolabmeng6!dfc61ec - Fix dropdown blur bug when values are provided as tuples. Thanks @abidlabs!128ab5d - Ensure checked files persist after FileExplorer rerenders. Thanks @hannahblair!798eca5 - Fit video media within Video component. Thanks @hannahblair!28a7aa9 - Mount on a FastAPI app with lifespan manager. Thanks @Xmaster6y!### Features - #6624 `1751f14` - Remove 2 slider demos from docs. Thanks @aliabd! - #6622 `4396f3f` - Fix encoding issue #6364 of reload mode. Thanks
1751f14 - Remove 2 slider demos from docs. Thanks @aliabd!4396f3f - Fix encoding issue #6364 of reload mode. Thanks @curiousRay!9919b8a - Fix the docstring decoration. Thanks @whitphx!9bf1ad4 - Fix uploaded file wasn't moved to custom temp dir at different disks. Thanks @dodysw!9bcb1da - Feat: make UploadButton accept icon. Thanks @Justin-Xiang!4f040c7 - Update zh-CN.json. Thanks @cibimo!13ace03 - Update file_explorer.py - Fixing error if nothing selected in file_count=single mode (return None rather). Thanks @v-chabaux!2b625ad - Ensure Chatbot messages are properly aligned when rtl is true. Thanks @hannahblair!b639e04 - Quick Image + Text Component Fixes. Thanks @dawoodkhan82!206af31 - Improve like/dislike functionality. Thanks @hannahblair!d548202 - Improve video trimming and error handling. Thanks @hannahblair!d92c819 - Add concurrency_limit to ChatInterface, add IDE support for concurrency_limit. Thanks @freddyaboulton!8fc562a - Add show_recording_waveform to Audio. Thanks @hannahblair!3156598 - Make FileExplorer work on python 3.8 and 3.9. Also make it update on changes to root, glob, or glob_dir. Thanks @freddyaboulton!b8034a1 - Fix: Gradio Client work with private Spaces. Thanks @abidlabs!### Features - #6537 `6d3fecfa4` - chore(deps): update all non-major dependencies. Thanks @renovate! ### Fixes - #6530 `13ef0f0ca` - Quick fix: Make c
Nothing published for this version
A brand new component, completely separate from Image that provides simple editing capabilities.
ImageEditor component (#6169 9caddc17b)A brand new component, completely separate from Image that provides simple editing capabilities.
1:1, etc)<video src="https://user-images.githubusercontent.com/12937446/284027169-31188926-fd16-4a1c-8718-998e7aae4695.mp4" autoplay muted></video>
def fn(im):
im["composite"] # the full canvas
im["background"] # the background image
im["layers"] # a list of individual layers
im = gr.ImageEditor(
# decide which sources you'd like to accept
sources=["upload", "webcam", "clipboard"],
# set a cropsize constraint, can either be a ratio or a concrete [width, height]
crop_size="1:1",
# enable crop (or disable it)
transforms=["crop"],
# customise the brush
brush=Brush(
default_size="25", # or leave it as 'auto'
color_mode="fixed", # 'fixed' hides the user swatches and colorpicker, 'defaults' shows it
default_color="hotpink", # html names are supported
colors=[
"rgba(0, 150, 150, 1)", # rgb(a)
"#fff", # hex rgb
"hsl(360, 120, 120)" # in fact any valid colorstring
]
),
brush=Eraser(default_size="25")
)
Thanks @pngwn!
### Features - #6467 `739e3a5a0` - Fix dev mode. Thanks @freddyaboulton!
739e3a5a0 - Fix dev mode. Thanks @freddyaboulton!### Features - #6428 `ac4ca59c9` - Extract video filenames correctly from URLs. Thanks @112292454! - #6461 `6b53330a5` - UploadButton tests. Thanks @f
ac4ca59c9 - Extract video filenames correctly from URLs. Thanks @112292454!6b53330a5 - UploadButton tests. Thanks @freddyaboulton!a1e3c61f4 - Allow setting a default_concurrency_limit other than 1. Thanks @abidlabs!179f5bcde - Add py.typed to gradio backend. Thanks @aleneum!58e3ca826 - Custom Component CLI Improvements. Thanks @freddyaboulton!2761b6d19 - Catch ValueError, KeyError when saving PIL Image. Thanks @freddyaboulton!62d35c3d1 - Issue 2085: Transformers object detection pipeline added. Thanks @cswamy!3953a1467 - Preserve original image extension in backend processing. Thanks @freddyaboulton!e0fc14659 - Allow google analytics to work on Spaces (and other iframe situations). Thanks @abidlabs!1959471a8 - Add download tests for audio/video. Thanks @freddyaboulton!2727f45fb - Do not show warnings when renaming api_names. Thanks @abidlabs!727ae2597 - chore: rename api_key to hf_token. Thanks @NickCrews!2f805a7dd - Small but important bugfixes for gr.Image: The upload event was not triggering at all. The paste-from-clipboard was not triggering an upload event. The clear button was not triggering a change event. The change event was triggering infinitely. Uploaded images were not preserving their original names. Uploading a new image should clear out the previous image. Thanks @freddyaboulton!2777f326e - Ensure Audio ouput events are dispatched. Thanks @hannahblair!f816136a0 - Add volume control to Audio. Thanks @hannahblair!d00fcf89d - Gradio custom component dev mode now detects changes to Example.svelte file. Thanks @freddyaboulton!bce6ca109 - Send more than one heartbeat message. Thanks @freddyaboulton!b3ba17dd1 - Update the selected indices in Dropdown when value changes programmatically. Thanks @abidlabs!### Features - #6395 `8ef48f852` - Async functions and async generator functions with the every option to work. Thanks @whitphx! - #6403 `9cfeb4f17` -
8ef48f852 - Async functions and async generator functions with the every option to work. Thanks @whitphx!9cfeb4f17 - Remove websockets dependency. Thanks @freddyaboulton!0401c77f3 - Move ffmpeg to Video deps. Thanks @hannahblair!d84209703 - Lite: SharedWorker mode. Thanks @whitphx!649f3ceb6 - Added docs on gr.Examples. Thanks @abidlabs!d31d8c6ad - Allows sources to be a string for gr.Image. Thanks @abidlabs!2090aad73 - Move wavesurfer dep to js/audio. Thanks @freddyaboulton!324867f63 - Fix event target. Thanks @aliabid94!03491ef49 - Fix docstrings and default value for api_name. Thanks @abidlabs!e76a9e8fc - Fix Chatbot Pending Message Issues. Thanks @dawoodkhan82!da1e31832 - Fix Model3D download button and other issues. Thanks @freddyaboulton!de998b281 - Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache. Thanks @abidlabs!### Features - #6333 `42f76aeeb` - Add AsyncGenerator to the check-list of dependencies.types.generator. Thanks @whitphx! - #6347 `d64787b88` - Fix co
42f76aeeb - Add AsyncGenerator to the check-list of dependencies.types.generator. Thanks @whitphx!d64787b88 - Fix colorFrom in theme space readmes. Thanks @abidlabs!4d3aad33a - Fix image upload. Thanks @freddyaboulton!854b482f5 - Redesign file upload. Thanks @hannahblair!37dd335e5 - Fix audio streaming output issues in 4.0. Thanks @aliabid94!f1409f95e - Provide status updates on file uploads. Thanks @freddyaboulton!8a3f45c26 - Fix component update bug. Thanks @freddyaboulton!6204ccac5 - Fixes gr.load() so it works properly with Images and Examples. Thanks @abidlabs!55fda81fa - Textbox and Code Component Blur/Focus Fixes. Thanks @dawoodkhan82!### Features - #6318 `d3b53a457` - Fix for stylized DataFrame. Thanks @abidlabs! - #6326 `ed546f2e1` - Fix Model3D template. Thanks @freddyaboulton! #
d3b53a457 - Fix for stylized DataFrame. Thanks @abidlabs!ed546f2e1 - Fix Model3D template. Thanks @freddyaboulton!dfdaf1092 - Fix data model for gr.DataFrame. Thanks @abidlabs!4b1011bab - Maintain text selection in Chatbot button elements. Thanks @hannahblair!bca6c2c80 - Restore query parameters in request. Thanks @aliabid94!19af2806a - Add autoplay to waveform_settings. Thanks @hannahblair!7ab73df48 - fix regarding callable function error. Thanks @SrijanSahaySrivastava!3cdeabc68 - Ensure source selection does not get hidden in overflow. Thanks @hannahblair!176c4d140 - Temporary fix to be able to load themes from Hub. Thanks @abidlabs!fad92c29d - Improve default source behaviour in Audio. Thanks @hannahblair!570866a3b - Hide show API link when in gradio lite. Thanks @hannahblair!c56128781 - Fix updating choices in gr.Dropdown and updates related to other components. Thanks @abidlabs!### Fixes - #6288 `92278729e` - Gallery preview fix and optionally skip download of urls in postprcess. Thanks @freddyaboulton! - #6289 `5668036ee` -
92278729e - Gallery preview fix and optionally skip download of urls in postprcess. Thanks @freddyaboulton!5668036ee - Fix file upload on windows. Thanks @freddyaboulton!e8216be94 - ensure gr.Dataframe updates as expected. Thanks @pngwn!### Features - #6261 `8bbeca0e7` - Improve Embed and CDN handling and fix a couple of related bugs. Thanks @pngwn! - #6241 `61c155e9b` - Remove sessio
8bbeca0e7 - Improve Embed and CDN handling and fix a couple of related bugs. Thanks @pngwn!61c155e9b - Remove session if browser closed on mobile. Thanks @aliabid94!4840b4bc2 - Add that api routes are automatically named to CHANGELOG. Thanks @freddyaboulton!dd901c1b0 - Model3D panning, improved UX. Thanks @dylanebert!12d8e90a1 - Fixes input Image component with streaming=True. Thanks @abidlabs!de36820ef - Fix various issues with demos on website. Thanks @aliabd!ac4f2bcde - Remove **kwargs from queue. Thanks @freddyaboulton!e3ede2ff7 - Ensure Model 3D updates when attributes change. Thanks @hannahblair!e32bac894 - Fix updating interactive prop. Thanks @abidlabs!27194a987 - Ensure the statustracker for gr.Image displays in static mode. Thanks @pngwn!aaa55ce85 - Video/Audio fixes. Thanks @freddyaboulton!6bce259c5 - Ensure gr.CheckboxGroup updates as expected. Thanks @pngwn!afb72bd19 - Fix bug where radio.select passes the previous value to the function instead of the selected value. Thanks @freddyaboulton!3e31c1752 - Add likeable to config for Chatbot. Thanks @freddyaboulton!2cffcf3c3 - ensure radios have different names. Thanks @pngwn!5cddd6588 - Fixes: Initial message is overwrtitten in chat interface. Thanks @dawoodkhan82!5fe091367 - handle selected_index prop change for gallery. Thanks @pngwn!a4a931dd3 - fixFileExplorer preprocess. Thanks @pngwn!d7a1a6559 - Fix file overflow and add keyboard navigation to FileExplorer. Thanks @hannahblair!### Fixes - #6191 `b555bc09f` - fix cdn build. Thanks @pngwn!
### Features - #6137 `2ba14b284` - JS Param. Thanks @dawoodkhan82! - #6181 `62ec2075c` - modify preprocess to use pydantic models. Thanks @abidlabs!
Gradio 4.0 is a new major version, and includes breaking changes from 3.x. Here's a list of all the breaking changes, along with migration steps where…
4.0 is a big release, so here are the main highlights:
1. Custom Components:
We've introduced the ability to create and publish you own custom gradio components. A custom Gradio component is a combination of Python and JavaScript (specifically, Svelte) that you can write to fully customize a Gradio component. A custom component can be used just like a regular Gradio component (with gr.Interface, gr.Blocks, etc.) and can be published so that other users can use it within their apps. To get started with Custom Components, read our quickstart guide here.
<img src="https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExMm9pbzhvaTd1MTFlM3FrMmRweTh1ZWZiMmpvemhpNnVvaXVoeDZ2byZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/V3N5jnv0D1eKbPYins/giphy.gif">
2. Redesigned Media Components and Accessibility:
We redesigned our media components (gr.Audio, gr.Image, and gr.Video) from scratch and improved accessibilty across the board. All components are now keyboard navigable and include better colors to be usable by a wider audience.
<img src="https://media0.giphy.com/media/Kv1bAN7MX3ya5krkEU/giphy.gif">
3. Server Side Events:
Gradio's built-in queuing system is now the default for every Gradio app. We now use Server Side Events instead of Websockets for the queue. SSE means everything is served over HTTP and has better device support and better scaling than websockets.
<img style="width:50%" src="https://i.imgur.com/ewUIuUc.png">
4. Custom Share Servers:
Gradio share links can now run on custom domains. You can now set up your own server to serve Gradio share links. To get started, read our guide here.
<img style="width:50%" src="https://i.imgur.com/VFWVsqn.png">
We now support adding arbitrary JS to your apps using the js parameter in Blocks, and arbitrary modifications to the <head> of your app using the head parameter in Blocks
We no longer expose a user's working directory by default when you release a Gradio app. There are some other improvements around security as well.
Previously, a Gradio app's API endpoints were exposed, allowing you to bypass the queue. As a Gradio developer, you needed to set api_open=False to prevent this misuse. We've now made this the default.
You can now control whether a user should be able to trigger the same event multiple times (by using the trigger_mode parameter of each event)
You now have fine-grained control over how many times each event can be running concurrently in the backend (using the concurrency_limit parameter of each event)
We no longer serialize images into base64 before sending them to the server or on the way back. This should make any Gradio app that includes gr.Image components much faster.
Gradio 4.0 is a new major version, and includes breaking changes from 3.x. Here's a list of all the breaking changes, along with migration steps where appropriate.
Components:
**kwarg from every component, meaning that components cannot accept arbitrary (unused) parameters. Previously, warnings would be thrown.plain is no longer an alias for secondary for the variant argument in the gr.Button classCarousel class and StatusTracker class and Box layout classVariable alias for State.style() methods from component classes.update() method from component classesget_interpretation_neighbors() and get_interpretation_scores() from component classesdeprecation.py -- this was designed for internal usage so unlikely to break gradio appssource param in gr.Audio and gr.Video to sourcesshow_edit_button param from gr.Audiotool= argument in gr.Image() has been removed. As of gradio==4.5.0, we have a new gr.ImageEditor component that takes its place. The ImageEditor component is a streamlined component that allows you to do basic manipulation of images. It supports setting a background image (which can be uploaded, pasted, or recorded through a webcam), as well the ability to "edit" the background image by using a brush to create strokes and an eraser to erase strokes in layers on top of the background image. See the Migrating to Gradio 4.0 section below.Other changes related to the gradio library:
status_tracker parameter from eventsHuggingFaceDatasetJSONSaver classBlocks.load() can only be use an is instance method to attach an event that runs when the page loads. To use the class method, use gr.load() insteadInterface.load() has been removedgr.load a Space that is running Gradio 3.x. However, you can still use the client libraries (see changes to the client libraries below).enable_queue from launch()gr.Series and gr.Parallelapi_name=None, the api name is the name of the python function.Changes related to the Client libraries:
gr.Chatbot, gr.Label, and gr.JSON), the data would get saved to a file and the filepath would be returned. Similarly, you would have to pass input JSON as a filepath. Now, the JSON data is passed and returned directly, making it easier to work with these components using the clients.Here are some concrete tips to help migrate to Gradio 4.0:
allowed_pathsSince the working directory is now not served by default, if you reference local files within your CSS or in a gr.HTML component using the /file= route, you will need to explicitly allow access to those files (or their parent directories) using the allowed_paths parameter in launch()
For example, if your code looks like this:
import gradio as gr
with gr.Blocks() as demo:
gr.HTML("<img src='/file=image.png' alt='image One'>")
demo.launch()
In order for the HTML component to be able to serve image.png, you will need to add image.png in allowed_paths like this:
import gradio as gr
with gr.Blocks() as demo:
gr.HTML("<img src='/file=image.png' alt='image One'>")
demo.launch(allowed_paths=["image.png"])
or if you want to expose all files in your working directory as was the case in Gradio 3.x (not recommended if you plan to share your app with others), you could do:
import gradio as gr
with gr.Blocks() as demo:
gr.HTML("<img src='/file=image.png' alt='image One'>")
demo.launch(allowed_paths=["."])
concurrency_limit instead of concurrency_countPreviously, in Gradio 3.x, there was a single global concurrency_count parameter that controlled how many threads could execute tasks from the queue simultaneously. By default concurrency_count was 1, which meant that only a single event could be executed at a time (to avoid OOM errors when working with prediction functions that utilized a large amount of memory or GPU usage). You could bypass the queue by setting queue=False.
In Gradio 4.0, the concurrency_count parameter has been removed. You can still control the number of total threads by using the max_threads parameter. The default value of this parameter is 40, but you don't have worry (as much) about OOM errors, because even though there are 40 threads, we use a single-worker-single-event model, which means each worker thread only executes a specific function. So effectively, each function has its own "concurrency count" of 1. If you'd like to change this behavior, you can do so by setting a parameter concurrency_limit, which is now a parameter of each event, not a global parameter. By default this is 1 for each event, but you can set it to a higher value, or to None if you'd like to allow an arbitrary number of executions of this event simultaneously. Events can also be grouped together using the concurrency_id parameter so that they share the same limit, and by default, events that call the same function share the same concurrency_id.
Lastly, it should be noted that the default value of the concurrency_limit of all events in a Blocks (which is normally 1) can be changed using the default_concurrency_limit parameter in Blocks.queue(). You can set this to a higher integer or to None. This in turn sets the concurrency_limit of all events that don't have an explicit conurrency_limit specified.
To summarize migration:
concurrency_limit=None in Gradio 4.0. (Previously you would set queue=False.)X executions of this function at a time, you should set concurrency_limit=X parameter in the event trigger.(Previously you would set a global concurrency_count=X.)The new ImageEditor component
In Gradio 4.0, the tool= argument in gr.Image() was removed. It has been replaced, as of Gradio 4.5.0, with a new gr.ImageEditor() component. The ImageEditor component is a streamlined component that allows you to do basic manipulation of images. It supports setting a background image (which can be uploaded, pasted, or recorded through a webcam), as well the ability to "edit" the background by using a brush to create strokes and an eraser to erase strokes in layers on top of the background image.
The ImageEditor component is much more performant and also offers much more flexibility to customize the component, particularly through the new brush and eraser arguments, which take Brush and Eraser objects respectively.
Here are some examples of how you might migrate from Image(tool=...) to gr.ImageEditor().
gr.Image(source="canvas", tools="sketch")
Now, you should write:
gr.ImageEditor(sources=(), brush=gr.Brush(colors=["#000000"]))
Note: you can supply a list of supported stroke colors in gr.Brush, as well as control whether users can choose their own colors by setting the color_mode parameter of gr.Brush to be either "fixed" or "defaults".
brush parameter. In other words, where previously, you would do:gr.Image(source="canvas", tools="color-sketch")
Now, you should write:
gr.ImageEditor(sources=())
gr.Image(source="upload", tools="color-sketch")
Now, this is the default behavior of the ImageEditor component, so you should just write:
gr.ImageEditor()
Unlike the Image component, which passes the input image as a single value into the prediction function, the ImageEditor passes a dictionary consisting of three key-value pairs:
"background", whose value is the background image"layers", which consists of a list of values, with the strokes in each layer corresponding to one list element."composite", whose value is to the complete image consisting of background image and all of the strokes.The type of each value can be set by the type parameter ("filepath", "pil", or "numpy", with the default being "numpy"), just like in the Image component.
Please see the documentation of the gr.ImageEditor component for more details: https://www.gradio.app/docs/imageeditor
86edc0199 - Remove gr.mix. Thanks @abidlabs!287fe6782 - fix circular dependency with client + upload. Thanks @pngwn!59f5a4e30 - Part I: Remove serializes. Thanks @abidlabs!287fe6782 - Don't serve files in working directory by default. Thanks @pngwn!287fe6782 - Small change to make api_open=False by default. Thanks @pngwn!287fe6782 - Add json schema unit tests. Thanks @pngwn!287fe6782 - Remove duplicate elem_ids from components. Thanks @pngwn!911829ac2 - Allow data at queue join. Thanks @aliabid94!287fe6782 - Moves gradio_cached_folder inside the gradio temp direcotry. Thanks @pngwn!287fe6782 - V4: Fix constructor_args. Thanks @pngwn!287fe6782 - Remove interpretation for good. Thanks @pngwn!287fe6782 - Improve Audio Component. Thanks @pngwn!287fe6782 - pass props to example components and to example outputs. Thanks @pngwn!287fe6782 - Clean root url. Thanks @pngwn!287fe6782 - Adds the ability to build the frontend and backend of custom components in preparation for publishing to pypi using gradio_component build. Thanks @pngwn!287fe6782 - Fix selectable prop in the backend. Thanks @pngwn!287fe6782 - Set api=False for cancel events. Thanks @pngwn!287fe6782 - Improve Video Component. Thanks @pngwn!287fe6782 - Try to trigger a major beta release. Thanks @pngwn!79c8156eb - Queue concurrency count. Thanks @aliabid94!287fe6782 - Image v4. Thanks @pngwn!287fe6782 - Publish all components to npm. Thanks @pngwn!287fe6782 - Open source FRP server and allow gradio to connect to custom share servers. Thanks @pngwn!287fe6782 - File upload optimization. Thanks @pngwn!287fe6782 - Custom components. Thanks @pngwn!287fe6782 - Removes deprecated arguments and parameters from v4. Thanks @pngwn!287fe6782 - V4: Use async version of shutil in upload route. Thanks @pngwn!287fe6782 - V4: Set cache dir for some component tests. Thanks @pngwn!287fe6782 - Proposal: sample demo for custom components should be a gr.Interface. Thanks @pngwn!287fe6782 - fix cc build. Thanks @pngwn!287fe6782 - --overwrite deletes previous content. Thanks @pngwn!28322422c - strip dangling svelte imports. Thanks @pngwn!287fe6782 - Swap websockets for SSE. Thanks @pngwn!1162ed621 - Remove show_edit_button param in Audio. Thanks @hannahblair!a7435ba9e - Fix static issues with Lite on v4. Thanks @aliabd!e4f7b4b40 - fix circular dependency with client + upload. Thanks @pngwn!667802a6c - JS Component Documentation. Thanks @freddyaboulton!103416d17 - JS READMEs and Storybook on Docs. Thanks @aliabd!c476bd5a5 - Image v4. Thanks @pngwn!90318b1dd - swap mode on the frontned to interactive to match the backend. Thanks @pngwn!9c3bf3175 - Don't serve files in working directory by default. Thanks @abidlabs!d2dfc1b9a - Small change to make api_open=False by default. Thanks @abidlabs!982bff2fd - Remove duplicate elem_ids from components. Thanks @hannahblair!f71ea09ae - Moves gradio_cached_folder inside the gradio temp direcotry. Thanks @abidlabs!a8ef6d5dc - Remove interpretation for good. Thanks @abidlabs!bce37ac74 - Fix selectable prop in the backend. Thanks @freddyaboulton!88bccfdba - Improve Video Component. Thanks @hannahblair!865a22d5c - Refactor Blocks.load() so that it is in the same style as the other listeners. Thanks @abidlabs!c3bc515bf - Gradio custom component publish. Thanks @freddyaboulton!db143bdd1 - Make output components not editable if they are being updated. Thanks @dawoodkhan82!d5d29c947 - Open source FRP server and allow gradio to connect to custom share servers. Thanks @abidlabs!0d261c6ec - Fix fallback demo app template code. Thanks @freddyaboulton!71bf2702c - Fix video. Thanks @abidlabs!bf127e124 - Swap websockets for SSE. Thanks @aliabid94!037e5af33 - WIP: Fix docs. Thanks @freddyaboulton!f08da1a6f - Fixes markdown rendering in examples. Thanks @abidlabs!0c571c044 - Add json schema unit tests. Thanks @freddyaboulton!83e947676 - Format js in v4 branch. Thanks @freddyaboulton!fadc057bb - V4: Fix constructor_args. Thanks @freddyaboulton!9cad2127b - Improve Audio Component. Thanks @hannahblair!cad537aac - pass props to example components and to example outputs. Thanks @pngwn!825c9cddc - Fix dev mode model3D. Thanks @freddyaboulton!9a40de7bf - Fix: Move to cache in init postprocess + Fallback Fixes. Thanks @freddyaboulton!184834d02 - Add a cli command to list available templates. Thanks @freddyaboulton!11d67ae75 - Add a stand-alone install command and tidy-up the fallback template. Thanks @freddyaboulton!338969af2 - V4: Single-file implementation of form components. Thanks @freddyaboulton!39227b6fa - Try to trigger a major beta release. Thanks @freddyaboulton!447dfe06b - Clean up backend of File and UploadButton and change the return type of preprocess() from TemporaryFIle to string filepath. Thanks @abidlabs!abff6fb75 - Fix remaining xfail tests in backend. Thanks @freddyaboulton!cd8146ba0 - Update logos for v4. Thanks @abidlabs!be2ed5e13 - File upload optimization. Thanks @freddyaboulton!6b0bb5e6a - Removes deprecated arguments and parameters from v4. Thanks @abidlabs!de18102b8 - V4: Fix component update bug. Thanks @freddyaboulton!9cf40f76f - V4: Simple dropdown. Thanks @freddyaboulton!85056de5c - V4: Simple textbox. Thanks @freddyaboulton!9053c95a1 - Simplify File Component. Thanks @freddyaboulton!35a227fbf - Proposal: sample demo for custom components should be a gr.Interface. Thanks @abidlabs!3b2d9eaa3 - fix cc build. Thanks @pngwn!287fe6782 - Pending events behavior. Thanks @pngwn!287fe6782 - Reinstate types that were removed in error in #5832. Thanks @pngwn!287fe6782 - Fixes: slider bar are too thin on FireFox. Thanks @pngwn!40a171ea6 - Fix image double change bug. Thanks @pngwn!0000a1916 - fix dropdown arrow size. Thanks @pngwn!bf38e5f06 - remove dupe component. Thanks @pngwn!7d07001e8 - fix storybook. Thanks @pngwn!ce036c5d4 - Pending events behavior. Thanks @dawoodkhan82!dbb7de5e0 - fix tests. Thanks @pngwn!e27997fe6 - Fix root when user is unauthenticated so that login page appears correctly. Thanks @abidlabs!f3f98f923 - Lite error handler. Thanks @whitphx!66549d8d2 - Fixes: slider bar are too thin on FireFox. Thanks @dawoodkhan82!Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Features - #5627 `b67115e8e` - Lite: Make the Examples component display media files using pseudo HTTP requests to the Wasm server. Thanks @whitph
b67115e8e - Lite: Make the Examples component display media files using pseudo HTTP requests to the Wasm server. Thanks @whitphx!1aa186220 - Lite: Fix Examples.create() to be a normal func so it can be called in the Wasm env. Thanks @whitphx!121f25b2d - Lite: Fix is_self_host() to detect 127.0.0.1 as localhost as well. Thanks @whitphx!e24163e15 - Added dimensionality check to avoid bad array dimensions. Thanks @THEGAMECHANGER416!46334780d - Mention that audio is normalized when converting to wav in docs. Thanks @aileenvl!a55b80942 - Add styling (e.g. font colors and background colors) support to gr.DataFrame through the pd.Styler object. Thanks @abidlabs!5f1cbc436 - Add support for gr.Request to gr.ChatInterface. Thanks @DarhkVoyd!c4e3a9274 - Fix curly brackets in docstrings. Thanks @whitphx!8d909624f - Fix styling issues with Audio, Image and Video components. Thanks @aliabd!e70805d54 - Change BlockLabel element to use <label>. Thanks @aileenvl!c07207e0b - Remove deprecated .update() usage from Interface internals. Thanks @abidlabs!b450cef15 - Fix type the docstring of the Code component. Thanks @whitphx!4e62b8493 - Ensure websocket polyfill doesn't load if there is already a global.Webocket property set. Thanks @Jay2theWhy!b83064da0 - Fix error when scrolling dropdown with scrollbar. Thanks @Kit-p!7b63db271 - Convert async methods in the Examples class into normal sync methods. Thanks @whitphx!891d42e9b - Define Font.repr() to be printed in the doc in a readable format. Thanks @whitphx!1d5b15a2d - Assert refactor in external.py. Thanks @harry-urek!48e09ee88 - Quick fix: Chatbot change event. Thanks @dawoodkhan82!c4ba832b3 - Remove deprecation warning from gr.update and clean up associated code. Thanks @abidlabs!0592c301d - Fix Dataframe line_breaks. Thanks @dawoodkhan82!fbce277e5 - Keep Markdown rendered lists within dataframe cells. Thanks @abidlabs!361823896 - Fix dataframe line_breaks. Thanks @dawoodkhan82!### Fixes - #5816 `796145e2c` - Fix calls to the component server so that gr.FileExplorer works on Spaces. Thanks @abidlabs!
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 (#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!
ed0f9a21b - Adds change() event to gr.Gallery. Thanks @abidlabs!4567788bd - Adds the ability to set the selected_index in a gr.Gallery. Thanks @abidlabs!caeee8bf7 - ensure the client does not depend on window when running in a node environment. Thanks @gibiee!a0d3cc45c - Fix gr.SelectData so that the target attribute is correctly attached, and the filedata is included in the data attribute with gr.Gallery. Thanks @abidlabs!957ba5cfd - Prevent bokeh from injecting bokeh js multiple times. Thanks @abidlabs!37e70842d - added try except block in state.py. Thanks @SrijanSahaySrivastava!f096c3ae1 - Throw helpful error when media devices are not found. Thanks @hannahblair!c0fef4454 - Revert replica proxy logic and instead implement using the root variable. Thanks @freddyaboulton!### Features - #5124 `6e56a0d9b` - Lite: Websocket queueing. Thanks @whitphx! ### Fixes - #5775 `e2874bc3c` - fix pending chatbot message styling and
### Features - #5699 `8f0fed857` - Improve chatbot accessibility and UX. Thanks @hannahblair! - #5569 `2a5b9e03b` - Added support for pandas Styler ob
8f0fed857 - Improve chatbot accessibility and UX. Thanks @hannahblair!2a5b9e03b - Added support for pandas Styler object to gr.DataFrame (initially just sets the display_value). Thanks @abidlabs!abb5e9df4 - Ensure images with no caption download in gallery. Thanks @hannahblair!502054848 - Fix Gallery columns and rows params. Thanks @abidlabs!e842a561a - Fix new line issue in chatbot. Thanks @dawoodkhan82!c9af4f794 - Added timeout and error handling for frpc tunnel. Thanks @cansik!ef96d3512 - Don't raise warnings when returning an updated component in a dictionary. Thanks @abidlabs!caf6d9c0e - Set share=True for all Gradio apps in Colab by default. Thanks @abidlabs!### Features - #5722 `dba651904` - Fix for deepcopy errors when running the replica-related logic on Spaces. Thanks @abidlabs! - #5721 `84e03fe50` - A
dba651904 - Fix for deepcopy errors when running the replica-related logic on Spaces. Thanks @abidlabs!84e03fe50 - Adds copy buttons to website, and better descriptions to API Docs. Thanks @aliabd!a0fc5a296 - Make Tab and Tabs updatable. Thanks @abidlabs!c10dabd6b - Fixes gr.select() Method Issues with Dataframe Cells. Thanks @dawoodkhan82!c2b31c396 - Context-based Progress tracker. Thanks @cbensimon!78e7cf516 - ensure internal data has updated before dispatching success or then events. Thanks @pngwn!d626c21e9 - Fully resolve generated filepaths when running on Hugging Face Spaces with multiple replicas. Thanks @abidlabs!aefb556ac - prevent internal log_message error from /api/predict. Thanks @cbensimon!96c4b97c7 - Adjust translation. Thanks @ylhsieh!3a48490bc - Add a bare Component type to the acceptable type list of gr.load()'s inputs and outputs. Thanks @whitphx!### Fixes - #5701 `ee8eec1e5` - Fix for regression in rendering empty Markdown. Thanks @abidlabs!
### Features - #5675 `b619e6f6e` - Reorganize Docs Navbar and Fill in Gaps. Thanks @aliabd! - #5669 `c5e969559` - Fix small issues in docs and guides.
b619e6f6e - Reorganize Docs Navbar and Fill in Gaps. Thanks @aliabd!c5e969559 - Fix small issues in docs and guides. Thanks @aliabd!c57f1b75e - Fix functional tests. Thanks @abidlabs!40de3d217 - add query parameters to the gr.Request object through the query_params attribute. Thanks @DarhkVoyd!ea0e00b20 - Prevent Clients from accessing API endpoints that set api_name=False. Thanks @abidlabs!e1874aff8 - Add gr.on listener method. Thanks @aliabid94!2e25d4305 - Pause autoscrolling if a user scrolls up in a gr.Textbox and resume autoscrolling if they go all the way down. Thanks @abidlabs!21c7225bd - Improve plot rendering. Thanks @aliabid94!9f9af327c - [Refactoring] Convert async functions that don't contain await statements to normal functions. Thanks @whitphx!d76555a12 - Fix secondary hue bug in gr.themes.builder(). Thanks @hellofreckles!f4e4f82b5 - Increase Slider clickable area. Thanks @dawoodkhan82!6a36c3b78 - chore(deps): update dependency @types/prismjs to v1.26.1. Thanks @renovate!da05e59a5 - Cleanup of .update and .get_config per component. Thanks @aliabid94!/n get_config is removed, the config used is simply any attribute that is in the Block that shares a name with one of the constructor paramaters./n update is not removed for backwards compatibility, but deprecated. Instead return the component itself. Created a updateable decorator that simply checks to see if we're in an update, and if so, skips the constructor and wraps the args and kwargs in an update dictionary. easy peasy.38fafb9e2 - Fix typos in Gallery docs. Thanks @atesgoral!d1ad1f671 - Attach elem_classes selectors to layout elements, and an id to the Tab button (for targeting via CSS/JS). Thanks @abidlabs!75ddeb390 - Accessibility Improvements. Thanks @hannahblair!6b1714386 - Upgrade Pyodide to 0.24.0 and install the native orjson package. Thanks @whitphx!9ccc4794a - Use ContextVar instead of threading.local(). Thanks @cbensimon!54d21d3f1 - Ensure HighlightedText with merge_elements loads without a value. Thanks @hannahblair!fb5964fb8 - Fix bug in example cache loading event. Thanks @freddyaboulton!341402337 - Allow Gradio apps containing gr.Radio(), gr.Checkboxgroup(), or gr.Dropdown() to be loaded with gr.load(). Thanks @abidlabs!7c34b434a - Fix width and height issues that would cut off content in gr.DataFrame. Thanks @abidlabs!faad01f8e - Add render_markdown parameter to chatbot. Thanks @dawoodkhan82!88d43bd12 - Fixes avatar image in chatbot being squashed. Thanks @dawoodkhan82!6b8c8afd9 - Fix incorrect behavior of gr.load() with gr.Examples. Thanks @abidlabs!e51fcd5d5 - setting share=True on Spaces or in wasm should warn instead of raising error. Thanks @abidlabs!### Features - #5964 `5fbda0bd2` - Wasm release. Thanks @pngwn!
### Features - #5498 `85ba6de13` - V4: Some misc fixes. Thanks @pngwn! - #5960 `319c30f3f` - rererefactor frontend files. Thanks @pngwn! - #5498 `85ba
85ba6de13 - V4: Some misc fixes. Thanks @pngwn!319c30f3f - rererefactor frontend files. Thanks @pngwn!85ba6de13 - Add host to dev mode for vite. Thanks @pngwn!d2314e53b - BugFix: Make FileExplorer Component Templateable. Thanks @pngwn!85ba6de13 - Use tags to identify custom component dirs and ignore uninstalled components. Thanks @pngwn!f769876e0 - Apply formatter (and small refactoring) to the Lite-related frontend code. Thanks @whitphx!13ed8a485 - V4: Use beta release versions for '@gradio' packages. Thanks @freddyaboulton!85ba6de13 - Adds the ability to build the frontend and backend of custom components in preparation for publishing to pypi using gradio_component build. Thanks @pngwn!85ba6de13 - Fix deployed demos on v4 branch. Thanks @pngwn!85ba6de13 - Set api=False for cancel events. Thanks @pngwn!85ba6de13 - Use full path to executables in CLI. Thanks @pngwn!1c390f101 - Merge main again. Thanks @pngwn!85ba6de13 - Simplify how files are handled in components in 4.0. Thanks @pngwn!85ba6de13 - Name Endpoints if api_name is None. Thanks @pngwn!dcf13d750 - V4: Update Component pyi file. Thanks @freddyaboulton!85ba6de13 - Rename gradio_component to gradio component. Thanks @pngwn!85ba6de13 - V4: Use async version of shutil in upload route. Thanks @pngwn!85ba6de13 - V4: Set cache dir for some component tests. Thanks @pngwn!fee3d527e - Adds column_widths to gr.Dataframe and hide overflowing text when wrap=False. Thanks @abidlabs!Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Features - #5514 `52f783175` - refactor: Use package.json for version management. Thanks @DarhkVoyd! - #5535 `d29b1ab74` - Makes sliders consisten
52f783175 - refactor: Use package.json for version management. Thanks @DarhkVoyd!d29b1ab74 - Makes sliders consistent across all browsers. Thanks @dawoodkhan82!e0d61b8ba - Fix .clear() events for audio and image. Thanks @dawoodkhan82!d9e9ae43f - Guide fixes, esp. streaming audio. Thanks @aliabid94!acdeff57e - Allow multiple instances of Gradio with authentication to run on different ports. Thanks @abidlabs!### Fixes - #5562 `50d9747d0` - chore(deps): update dependency iframe-resizer to v4.3.7. Thanks @renovate! - #5550 `4ed5902e7` - Adding basque languag
50d9747d0 - chore(deps): update dependency iframe-resizer to v4.3.7. Thanks @renovate!4ed5902e7 - Adding basque language. Thanks @EkhiAzur!290f51871 - typo in UploadButton's docstring. Thanks @chaeheum3!d1bf23cd2 - Modify Image examples docstring. Thanks @freddyaboulton!ba64082ed - preprocess for components when type='index'. Thanks @abidlabs!### Fixes - #5537 `301c7878` - allow gr.Image() examples to take urls. Thanks @abidlabs! - #5544 `a0cc9ac9` - Fixes dropdown breaking if a user types
### Fixes - #5516 `c5fe8eba` - Fix docstring of dropdown. Thanks @hysts! - #5529 `81c9ca9a` - Fix .update() method in gr.Dropdown() to handle choices.
### Features - #5505 `9ee20f49` - Validate i18n file names with ISO-639x. Thanks @hannahblair! - #5475 `c60b89b0` - Adding Central Kurdish. Thanks @Hr
9ee20f49 - Validate i18n file names with ISO-639x. Thanks @hannahblair!c60b89b0 - Adding Central Kurdish. Thanks @Hrazhan!d112e261 - Allow interactive input in gr.HighlightedText. Thanks @hannahblair!8909e42a - Adds autoscroll param to gr.Textbox(). Thanks @dawoodkhan82!ddc02268 - Allows the gr.Dropdown to have separate names and values, as well as enables allow_custom_value for multiselect dropdown. Thanks @abidlabs!b271e738 - Remove except asyncio.CancelledError which is no longer necessary due to 53d7025. Thanks @whitphx!041560f9 - Fix queueing.call_prediction to retrieve the default response class in the same manner as FastAPI's implementation. Thanks @whitphx!afcf3c48 - Do not expose existence of files outside of working directory. Thanks @abidlabs!bd2fda77 - Dispatch stop_recording event in Audio. Thanks @hannahblair!05715f55 - Adds a filterable parameter to gr.Dropdown that controls whether user can type to filter choices. Thanks @abidlabs!a4e010a9 - Fix share button position. Thanks @dawoodkhan82!82ec4d26 - Allow interface with components to be run inside blocks. Thanks @abidlabs!### Fixes - #5456 `6e381c4f` - ensure dataframe doesn't steal focus. Thanks @pngwn!
### Fixes - #5445 `67bb7bcb` - ensure dataframe doesn't scroll unless needed. Thanks @pngwn! - #5447 `7a4a89e5` - ensure iframe is correct size on spa
### Features - #5165 `c77f05ab` - Fix the Queue to call API endpoints without internal HTTP routing. Thanks @whitphx! - #5427 `aad7acd7` - Add sort to
c77f05ab - Fix the Queue to call API endpoints without internal HTTP routing. Thanks @whitphx!aad7acd7 - Add sort to bar plot. Thanks @Chaitanya134!afac0006 - significantly improve the performance of gr.Dataframe for large datasets. Thanks @pngwn!d14d63e3 - Auto scroll to bottom of textbox. Thanks @dawoodkhan82!26fef8c7 - Skip view_api request in js client when auth enabled. Thanks @freddyaboulton!7ab4b70f - api_open does not take precedence over show_api. Thanks @freddyaboulton!```python with gr.Blocks() as demo: name = gr.Textbox(label="Name") output = gr.Textbox(label="Output Box") greet_btn = gr.Button("Greet")
abf1c57d)Thanks @dawoodkhan82!
55fed04f)e.g.
with gr.Blocks() as demo:
name = gr.Textbox(label="Name")
output = gr.Textbox(label="Output Box")
greet_btn = gr.Button("Greet")
@greet_btn.click(inputs=name, outputs=output)
def greet(name):
return "Hello " + name + "!"
Thanks @aliabid94!
c5bf9138 - Add chat bubble width param. Thanks @dawoodkhan82!119c8343 - Faster reload mode. Thanks @freddyaboulton!79d8f9d8 - Adds height and zoom_speed parameters to Model3D component, as well as a button to reset the camera position. Thanks @abidlabs!61803c65 - chore(deps): update dependency extendable-media-recorder to v9. Thanks @renovate!4ccb9a86 - Makes it possible to set the initial camera position for the Model3D component as a tuple of (alpha, beta, radius). Thanks @mbahri!97c3c7b1 - Move scripts from old website to CI. Thanks @aliabd!b8968898 - Fix typo in utils.py. Thanks @eltociear!05892302 - Adds kwarg to disable html sanitization in gr.Chatbot(). Thanks @dawoodkhan82!0cc7e2dc - Hide avatar when message none. Thanks @dawoodkhan82!e4e7a431 - Renders LaTeX that is added to the page in gr.Markdown, gr.Chatbot, and gr.DataFrame. Thanks @abidlabs!4d94ea0a - Adds horizontal scrolling to content that overflows in gr.Markdown. Thanks @abidlabs!b27f7583 - Change markdown rendering to set breaks to false. Thanks @abidlabs!64666525 - Cancel Dropdown Filter. Thanks @deckar01!### Features - #5284 `5f25eb68` - Minor bug fix sweep. Thanks @aliabid94!/n - Our use of __exit__ was catching errors and corrupting the traceback of
5f25eb68 - Minor bug fix sweep. Thanks @aliabid94!/n - Our use of exit was catching errors and corrupting the traceback of any component that failed to instantiate (try running blocks_kitchen_sink off main for an example). Now the exit exits immediately if there's been an exception, so the original exception can be printed cleanly/n - HighlightedText was rendering weird, cleaned it up3341148c - Fix: wrap avatar-image in a div to clip its shape. Thanks @Keldos-Li!df090e89 - Fix Checkbox select dispatch. Thanks @freddyaboulton!### Fixes - #5324 `31996c99` - ensure login form has correct styles. Thanks @pngwn! - #5323 `e32b0928` - ensure dropdown stays open when identical dat
We now have better support for markdown in gr.Markdown and gr.Dataframe. Including syntax highlighting and Github Flavoured Markdown. We also have mor
fe057300)We now have better support for markdown in gr.Markdown and gr.Dataframe. Including syntax highlighting and Github Flavoured Markdown. We also have more consistent markdown behaviour and styling.
These improvements will be particularly beneficial to large applications.
gr.3DModel does re-render prematurely.Thanks @pngwn!
390624d8)The gradio_client now supports streaming file outputs 🌊
No new syntax! Connect to a gradio demo that supports streaming file outputs and call predict or submit as you normally would.
import gradio_client as grc
client = grc.Client("gradio/stream_audio_out")
# Get the entire generated audio as a local file
client.predict("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict")
job = client.submit("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict")
# Get the entire generated audio as a local file
job.result()
# Each individual chunk
job.outputs()
Thanks @freddyaboulton!
render function to <gradio-app> (#5158 804fcc05)We now have an event render on the <gradio-app> web component, which is triggered once the embedded space has finished rendering.
<script>
function handleLoadComplete() {
console.log("Embedded space has finished rendering");
}
const gradioApp = document.querySelector("gradio-app");
gradioApp.addEventListener("render", handleLoadComplete);
</script>
Thanks @hannahblair!
f49028cf - Move markdown & latex processing to the frontend for the gr.Markdown and gr.DataFrame components. Thanks @abidlabs!fbdad78a - Lazy load interactive or static variants of a component individually, rather than loading both variants regardless. This change will improve performance for many applications. Thanks @pngwn!4b58ea6d - Update i18n tokens and locale files. Thanks @hannahblair!a7460557 - Add height parameter and scrolling to gr.Dataframe. Thanks @abidlabs!c57d4c23 - gr.Radio and gr.CheckboxGroup can now accept different names and values. Thanks @abidlabs!e8fd4e4e - Add api_name parameter to gr.Interface. Additionally, completely hide api page if show_api=False. Thanks @freddyaboulton!a2f42e28 - Allow updating the label of gr.UpdateButton. Thanks @abidlabs!1cefee7f - chore(deps): update dependency marked to v7. Thanks @renovate!a773eaf7 - Stop passing inputs and preprocessing on iterators. Thanks @aliabid94!947d615d - Sign in with Hugging Face (OAuth support). Thanks @Wauplin!cf167cd1 - Create event listener table for components on docs. Thanks @aliabd!730f0c1d - Ensure gradio client works as expected for functions that return nothing. Thanks @raymondtri!b22e1888 - Fix the images in the theme builder to use permanent URI. Thanks @abidlabs!f344592a - Allows setting a height to gr.File and improves the UI of the component. Thanks @abidlabs!06982212 - Removes scrollbar from File preview when not needed. Thanks @abidlabs!15075241 - Rotate axes labels on LinePlot, BarPlot, and ScatterPlot. Thanks @Faiga91!92282cea - Chatbot Avatar Images. Thanks @dawoodkhan82!b3e50db9 - Remove aiohttp dependency. Thanks @freddyaboulton!46a2b600 - ensure translations for audio work correctly. Thanks @hannahblair!933db53e - Better handling of empty dataframe in gr.DataFrame. Thanks @abidlabs!2b397791 - Fix message text overflow onto copy button in gr.Chatbot. Thanks @hannahblair!ddac7e4d - Ensure File component uploads files to the server. Thanks @pngwn!6fb92b48 - Fixes audio streaming issues. Thanks @aliabid94!7b8fa8aa - Allow caching examples with streamed output. Thanks @aliabid94!cdfd4217 - Tweaks to icon parameter in gr.Button(). Thanks @abidlabs!3b805346 - Allows code block in chatbot to scroll horizontally. Thanks @dawoodkhan82!f769cb67 - only start listening for events after the components are mounted. Thanks @pngwn!c39f06e1 - Fix .update() for gr.Radio() and gr.CheckboxGroup(). Thanks @abidlabs!87f1c2b4 - Allow gr.Interface.from_pipeline() and gr.load() to work within gr.Blocks(). Thanks @abidlabs!de23e9f7 - Improve audio streaming. Thanks @aliabid94!/n - Proper audio streaming with WAV files. We now do the proper processing to stream out wav files as a single stream of audio without any cracks in the seams./n - Audio streaming with bytes. Stream any audio type by yielding out bytes, and it should work flawlessly.54bcb724 - Restores missing part of bottom border on file component. Thanks @abidlabs!1ecf88ac - fix #5229. Thanks @breengles!502f1015 - Ensure Blocks translation copy renders correctly. Thanks @hannahblair!a0f22626 - make_waveform() twitter video resolution fix. Thanks @dawoodkhan82!Nothing published for this version
Previously, Client.predict would only return the first output of an endpoint that streamed results. This was causing confusion for developers that wan
35856f8b)Previously, Client.predict would only return the first output of an endpoint that streamed results. This was causing confusion for developers that wanted to call these streaming demos via the client.
We realize that developers using the client don't know the internals of whether a demo streams or not, so we're changing the behavior of predict to match developer expectations.
Using Client.predict will now return the final output of a streaming endpoint. This will make it even easier to use gradio apps via the client.
Thanks @freddyaboulton!
Allows users to use generators to stream audio out, yielding consecutive chunks of audio. Requires streaming=True to be set on the output audio.
import gradio as gr
from pydub import AudioSegment
def stream_audio(audio_file):
audio = AudioSegment.from_mp3(audio_file)
i = 0
chunk_size = 3000
while chunk_size*i < len(audio):
chunk = audio[chunk_size*i:chunk_size*(i+1)]
i += 1
if chunk:
file = f"/tmp/{i}.mp3"
chunk.export(file, format="mp3")
yield file
demo = gr.Interface(
fn=stream_audio,
inputs=gr.Audio(type="filepath", label="Audio file to stream"),
outputs=gr.Audio(autoplay=True, streaming=True),
)
demo.queue().launch()
From the backend, streamed outputs are served from the /stream/ endpoint instead of the /file/ endpoint. Currently just used to serve audio streaming output. The output JSON will have is_stream: true, instead of is_file: true in the file data object. Thanks @aliabid94!
d7f83823 - solve how can I config root_path dynamically? #4968. Thanks @eastonsuo!6693660a - Add download button to selected images in Gallery. Thanks @hannahblair!61129052 - Update dependency esbuild to ^0.19.0. Thanks @renovate!80be7a1c - chatbot conversation nodes can contain a copy button. Thanks @fazpu!0b74a159 - Use importlib in favor of deprecated pkg_resources. Thanks @jayceslesar!3b9494f5 - Lite: Fix the analytics module to use asyncio to work in the Wasm env. Thanks @whitphx!5244c587 - Allow new lines in HighlightedText with /n and preserve whitespace. Thanks @hannahblair!2745075a - Add deploy_discord to docs. Thanks @freddyaboulton!0dc49b4c - Add support for async functions and async generators to gr.ChatInterface. Thanks @abidlabs!883ac364 - Add step param to Number. Thanks @hannahblair!22aa5eba - Use font size --text-md for <code> in Chatbot messages. Thanks @jaywonchung!f5539c76 - Enhancement: Add focus event to textbox and number component. Thanks @JodyZ0203!34f6b22e - Strip leading and trailing spaces from username in login route. Thanks @sweep-ai!144df459 - Add show_edit_button param to gr.Audio. Thanks @hannahblair!eaa1ce14 - Enhancing Tamil Translation: Language Refinement 🌟. Thanks @sanjaiyan-dev!8b4eb8ca - JS Client: Fixes cannot read properties of null (reading 'is_file'). Thanks @raymondtri!e6317d77 - Update dependency extendable-media-recorder to v8. Thanks @renovate!13e47835 - chore(deps): update dependency extendable-media-recorder to v8. Thanks @renovate!37caa2e0 - Add icon and link params to gr.Button. Thanks @hannahblair!7d897165 - gr.Dropdown now has correct behavior in static mode as well as when an option is selected. Thanks @abidlabs!667875b2 - Live audio streaming output1b017e68 - Add interactive args to gr.ColorPicker. Thanks @hannahblair!56d2609d - Reset textbox value to empty string when value is None. Thanks @hannahblair!67265a58 - Allow supporting >1000 files in gr.File() and gr.UploadButton(). Thanks @abidlabs!80727bbe - Fix dataset features and dataset preview for HuggingFaceDatasetSaver. Thanks @freddyaboulton!620e4645 - gr.Dropdown() now supports values with arbitrary characters and doesn't clear value when re-focused. Thanks @abidlabs!136adc9c - Ensure gradio_client is backwards compatible with gradio==3.24.1. Thanks @abidlabs!97d804c7 - [Spaces] ZeroGPU Queue fix. Thanks @cbensimon!cd1353fa - Fixes the display of minutes in the video player. Thanks @abidlabs!b84a35b7 - Add icon and link to DuplicateButton. Thanks @aliabd!f6c491b0 - highlightedtext throws an error basing on model. Thanks @rajeunoia!We're excited to announce that Gradio can now automatically create a discord bot from any gr.ChatInterface app.
46e4ef67)We're excited to announce that Gradio can now automatically create a discord bot from any gr.ChatInterface app.
It's as easy as importing gradio_client, connecting to the app, and calling deploy_discord!
🦙 Turning Llama 2 70b into a discord bot 🦙
import gradio_client as grc
grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot")
<img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/guide/llama_chat.gif">
To help get you started, we have created an organization on Hugging Face called gradio-discord-bots with template spaces you can use to turn state of the art LLMs powered by Gradio to discord bots.
Currently we have template spaces for:
But once again, you can deploy ANY gr.ChatInterface app exposed on the internet! So don't hesitate to try it on your own Chatbots.
❗️ Additional Note ❗️: Technically, any gradio app that exposes an api route that takes in a single string and outputs a single string can be deployed to discord. But gr.ChatInterface apps naturally lend themselves to discord's chat functionality so we suggest you start with those.
Thanks @freddyaboulton!
3f8c210b - Implement left and right click in Gallery component and show implicit images in Gallery grid. Thanks @hannahblair!dc07a9f9 - Bringing back the "Add download button for audio" PR by @leuryr. Thanks @abidlabs!44ac8ad0 - Allow setting sketch color default. Thanks @aliabid94!b74f8453 - Adds additional_inputs to gr.ChatInterface. Thanks @abidlabs!41c83070 - Add CSS resets and specifiers to play nice with HF blog. Thanks @aliabid94!Nothing published for this version
Nothing published for this version
Hotfix to support pydantic v1 and v2 by @freddyaboulton in PR 4835
gr.File change event was not triggered when the value was changed by another event by @freddyaboulton in PR 4811No changes to highlight.
No changes to highlight.
Deprecation warnings now point at the user code using those deprecated features, instead of Gradio internals, by (https://github.com/akx) in PR 4694
gr.Video, gr.Audio, gr.Image, gr.Chatbot, and gr.Gallery components now include a share icon when deployed on Spaces. This behavior can be modified by setting the show_share_button parameter in the component classes. by @aliabid94 in PR 4651space, src, and host attributes to be updated dynamically by @pngwn in PR 4461api_name parameter now accepts False as a value, which means it does not show up in named or unnamed endpoints. By @abidlabs in PR 4683pathlib.Path in gr.Video, gr.Gallery, and gr.Chatbot by sunilkumardash9 in PR 4581.info attribute to update when update() is called on them. by @jebarpg in PR 4715.Image components undo button works mode is mask or color-sketch by @amyorz in PR 4692gr.components by @abidlabs in PR 4566select event was not triggered in gr.Gallery if height was set to be large with allow_preview=False by @freddyaboulton in PR 4551visible=False in gr.Group event did not work by @abidlabs in PR 4567make_waveform to work with paths that contain spaces @akx in PR 4570 & PR 4578stop_recording event for gr.Audio and gr.Video components by @freddyaboulton in PR 4554gr.Gallery where height and object_fit parameters where being ignored by @freddyaboulton in PR 4576AnnotatedImage css styling was causing the annotation masks to not be displayed correctly by @freddyaboulton in PR 4628Progress component now appears even when no iterable is specified in tqdm constructor by @itrushkin in PR 4475plot parameter deprecation warnings should now only be emitted for Image components by @freddyaboulton in PR 4709type deprecation warning by @freddyaboulton in PR 4709autoplay=True and the video source is dynamically updated @pngwn in PR 4705gr.Dropdown being cutoff at the bottom by @abidlabs in PR 4691.show_label was hiding the entire component for gr.Label by @freddyaboulton in PR 4713.git-blame-ignore-revs by @akx in PR 4586typing.Literal where possible in gradio library and client by @freddyaboulton in PR 4608cleared_value from some components as its no longer used internally by @freddyaboulton in PR 4685PR 4683 removes the explict named endpoint "load_examples" from gr.Interface that was introduced in PR 4456.
Fix chatbot streaming by @aliabid94 in PR 4537
No changes to highlight.
No changes to highlight.
No changes to highlight.
Fix chatbot streaming by @aliabid94 in PR 4537
No changes to highlight.
No changes to highlight.
No changes to highlight.
A gr.ClearButton which allows users to easily clear the values of components by @abidlabs in PR 4456
gr.ClearButton which allows users to easily clear the values of components by @abidlabs in PR 4456Example usage:
import gradio as gr
with gr.Blocks() as demo:
chatbot = gr.Chatbot([("Hello", "How are you?")])
with gr.Row():
textbox = gr.Textbox(scale=3, interactive=True)
gr.ClearButton([textbox, chatbot], scale=1)
demo.launch()
start_recording and stop_recording events to Video and Audio components by @pngwn in PR 4422autoplay kwarg to Video and Audio components by @pngwn in PR 4453allow_preview parameter to Gallery to control whether a detailed preview is displayed on click by
@freddyaboulton in PR 4470latex_delimiters parameter to Chatbot to control the delimiters used for LaTeX and to disable LaTeX in the Chatbot by @dawoodkhan82 in PR 4516gr.Warning and gr.Info modals. Simply put the code gr.Warning("Your warning message") or gr.Info("Your info message") as a standalone line in your function. By @aliabid94 in PR 4518.Example:
def start_process(name):
gr.Info("Starting process")
if name is None:
gr.Warning("Name is empty")
...
if success == False:
raise gr.Error("Process failed")
<a> element, by @akx in PR 4449.format='mp4' on a video component would cause the function to error out if the uploaded video was not playable by @freddyaboulton in PR 4467_js parameter to work even without backend function, by @aliabid94 in PR 4486.gr.Chatbot() by @dawoodkhan82 in PR 4491Label component by @abidlabs in PR 4456show_label will not automatically be set to True in gr.BarPlot.update by @freddyaboulton in PR 4531gr.BarPlot group text now respects darkmode by @freddyaboulton in PR 4531new Promise()s by @akx in PR 4442.mount_gradio_app, by @charlesfrye in PR4519.Clear button has been changed for Slider, CheckboxGroup, Radio, Dropdown components by @abidlabs in PR 4456. The Clear button now sets the value of these components to be empty as opposed to the original default set by the developer. This is to make them in line with the rest of the Gradio components.$ as a default LaTeX delimiter for the Chatbot by @dawoodkhan82 in PR 4516. The specific LaTeX delimeters can be set using the new latex_delimiters parameter in Chatbot.Deprecated .style parameter and moved arguments to constructor. Added support for .update() to all arguments initially in style. Added scale and min_w…
gr.UploadButton component now supports the variant and interactive parameters by @abidlabs in PR 4436.gr.File(file_count='multiple') could not be cached as output by @freddyaboulton in PR 4421/proxy route by @abidlabs in PR 4406.gr.UploadButton could not be used to upload the same file twice by @dawoodkhan82 in PR 4437/proxy route was being incorrectly constructed by the frontend by @abidlabs in PR 4430.import spaces; spaces.disable_gradio_auto_wrap() by @cbensimon in PR 4389..style parameter and moved arguments to constructor. Added support for .update() to all arguments initially in style. Added scale and min_width support to every Component. By @aliabid94 in PR 4374No changes to highlight.
Your coding agent can read these notes before it upgrades. Set up the MCP server →