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
Allow every to work with generators by @dkjshk in PR 4434
No changes to highlight.
every to work with generators by @dkjshk in PR 4434validate_url to check for 403 errors and use a GET request in place of a HEAD by @alvindaiyan in PR 4388.No changes to highlight.
One column per quarter.
Introduced gradio deploy to launch a Gradio app to Spaces directly from your terminal. By @aliabid94 in PR 4033.
gradio deploy to launch a Gradio app to Spaces directly from your terminal. By @aliabid94 in PR 4033.show_progress='corner' argument to event listeners, which will not cover the output components with the progress animation, but instead show it in the corner of the components. By @aliabid94 in PR 4396.Blocks.load behave like other event listeners (allows chaining then off of it) @anentropic in PR 4304interactive=True in output components of a gr.Interface by @abidlabs in PR 4356./file routes by @abidlabs in PR 4370./proxy route by @abidlabs in PR 4368.markedjs sanitize function with DOMPurify sanitizer for gr.Chatbot() by @dawoodkhan82 in PR 4360Interface.launch() and Blocks.launch() now accept an app_kwargs argument to allow customizing the configuration of the underlying FastAPI app, by @akx
Interface.launch() and Blocks.launch() now accept an app_kwargs argument to allow customizing the configuration of the underlying FastAPI app, by @akx in PR 4282run_on_click parameter in gr.Examples by @abidlabs in PR 4258.initial_height attribute by @whitphx in PR 4223mount_css fn to remove circular dependency @whitphx in PR 4222gr.Chatbot() using KaTeX by @dawoodkhan82 in PR 4285.No changes to highlight.
The deprecation warnings for kwargs now show the actual stack level for the invocation, by @akx in PR 4203.
gradio app.py) can now accept command line arguments by @micky2be in PR 4119format argument to Audio component by @freddyaboulton in PR 4178chatbot_dialogpt demo by @dawoodkhan82 in PR 4238.gr.Chatbot() markdown parsing to frontend using marked library and prism by @dawoodkhan82 in PR 4150Image component by @der3318 in PR 4204.No changes to highlight.
Adds a root_path parameter to launch() that allows running Gradio applications on subpaths (e.g. www.example.com/app) behind a proxy, by @abidlabs in
root_path parameter to launch() that allows running Gradio applications on subpaths (e.g. www.example.com/app) behind a proxy, by @abidlabs in PR 4133.input event listener, which is only triggered when a user changes the component value (as compared to .change, which is also triggered when a component updates as the result of a function trigger), by @aliabid94 in PR 4157.gr.File(file_count='multiple') output components by @freddyaboulton in PR 4153No changes to highlight.
No changes to highlight.
Returning language agnostic types in the /info route by @freddyaboulton in PR 4039
/info route by @freddyaboulton in PR 4039gr.Slider release event not triggering on mobile by @space-nuko in PR 4098State component info from the /info route by @abidlabs in PR 4107No changes to highlight.
No changes to highlight.
No changes to highlight.
zh-cn.json to zh-CN.json by @abidlabs in PR 4086No changes to highlight.
Nothing published for this version
Fixes issue with indentation in gr.Code() component with streaming by @dawoodkhan82 in PR 4043
No changes to highlight.
gr.Code() component with streaming by @dawoodkhan82 in PR 4043No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Code component visual updates by @pngwn in PR 4051
visual-question-answering, document-question-answering, and image-to-text using gr.Interface.load("models/...") and gr.Interface.from_pipeline by @osanseviero in PR 3887gr.Chatbot(), by @dawoodkhan82 in PR 4048matplotlib not rendering correctly if the backend was not set to Agg by @abidlabs in PR 4029gr.State across different Interfaces/Blocks within larger Blocks would not work by @abidlabs in PR 4030No changes to highlight.
gr.HuggingFaceDatasetSaver behavior changed internally. The flagging/ folder is not a .git/ folder anymore when using it. organization parameter is now ignored in favor of passing a full dataset id as dataset_name (e.g. "username/my-dataset").\n) are not automatically converted to <br> in gr.Markdown() or gr.Chatbot(). For multiple new lines, a developer must add multiple <br> tags.gr.HuggingFaceDatasetSaver using HTTP methods instead of git pull/push by @Wauplin in PR 3973No changes to highlight.
Add a "clear mask" button to gr.Image sketch modes, by @space-nuko in PR 3615
gr.Image sketch modes, by @space-nuko in PR 3615No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Fix duplicate play commands in full-screen mode of 'video'. by @tomchang25 in PR 3968.
gr.Video() would not work inside a gr.Tab() by @dawoodkhan82 in PR 3891gr.Gallery() where setting height causes aspect ratio of images to collapse by @dawoodkhan82 in PR 3830[PR 3895](https://github.com/gradio-app/gradio/pull/3895).[PR 3895](https://github.com/gradio-app/gradio/pull/3895).Status enum by @10zinten in PR 3931gr.ChatBot to handle image url tye-singwa in PR 3953gr consistent across the docs by @duerrsimon in PR 3901gradio.themes utilities (introduced in 3.24.0) have been eradicated.
By @akx in PR 3958gr.themes.builder() by @deepkyu in PR 3869_js and setting outputs to None in gradio.Blocks() by @DavG25 in PR 3883No changes to highlight.
New AnnotatedImage component allows users to highlight regions of an image, either by providing bounding boxes, or 0-1 pixel masks. This component is
New AnnotatedImage component allows users to highlight regions of an image, either by providing bounding boxes, or 0-1 pixel masks. This component is useful for tasks such as image segmentation, object detection, and image captioning.
Example usage:
with gr.Blocks() as demo:
img = gr.Image()
img_section = gr.AnnotatedImage()
def mask(img):
top_left_corner = [0, 0, 20, 20]
random_mask = np.random.randint(0, 2, img.shape[:2])
return (img, [(top_left_corner, "left corner"), (random_mask, "random")])
img.change(mask, img, img_section)
See the image_segmentation demo for a full example. By @aliabid94 in PR 3836
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Allow the video component to accept subtitles as input, by @tomchang25 in PR 3673. To provide subtitles, simply return a tuple consisting of (path_to_
Video component supports subtitles(path_to_video, path_to_subtitles) from your function. Both .srt and .vtt formats are supported:with gr.Blocks() as demo:
gr.Video(("video.mp4", "captions.srt"))
gr.Chatbot() component by @dawoodkhan82 in PR 3816Updates the "view API" page in Gradio apps to use the gradio_client library by @aliabd in PR 3765
Read more about how to use the gradio_client library here: https://gradio.app/getting-started-with-the-python-client/
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Nothing published for this version
Nothing published for this version
Improve error messages when number of inputs/outputs to event handlers mismatch, by @space-nuko in PR 3519
Improve error messages when number of inputs/outputs to event handlers mismatch, by @space-nuko in PR 3519
Add select listener to Images, allowing users to click on any part of an image and get the coordinates of the click by @aliabid94 in PR 3786.
with gr.Blocks() as demo:
img = gr.Image()
textbox = gr.Textbox()
def select_handler(img, evt: gr.SelectData):
selected_pixel = img[evt.index[1], evt.index[0]]
return f"Selected pixel: {selected_pixel}"
img.select(select_handler, img, textbox)
rows, columns and object-fit in style() for gr.Gallery() component by @dawoodkhan82 in PR 3586file_count='multiple' case by @freddyaboulton in PR 3782No changes to highlight.
No changes to highlight.
No changes to highlight.
Fixes Chatbot issue where new lines were being created every time a message was sent back and forth by @aliabid94 in PR 3717.
select event once the dataframe has been selected. By @yiyuezhuo in PR 3861No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Trigger the release event when Slider number input is released or unfocused by @freddyaboulton in PR 3589
Trigger the release event when Slider number input is released or unfocused by @freddyaboulton in PR 3589
Created Theme Builder, which allows users to create themes without writing any code, by @aliabid94 in PR 3664. Launch by:
import gradio as gr
gr.themes.builder()
The Dropdown component now has a allow_custom_value parameter that lets users type in custom values not in the original list of choices.
The Colorpicker component now has a .blur() event
By @freddyaboulton in PR 3581.
Chatbot and Image components so that files passed during processing are added to a directory where they can be served from, by @abidlabs in PR 3523huggingface_hub @dawoodkhan82 in PR 3488gr.load() loads and applies the upstream theme, by @abidlabs in PR 3641lines set to larger than 20 by @dawoodkhan82 in PR 3637gr.Dataframe value, by @space-nuko in PR 3646gr.Image not filling the entire element size, by @space-nuko in PR 3649gr.Code support the lines property, by @space-nuko in PR 3651_js return values being double wrapped in an array, by @space-nuko in PR 3594gr.File component to state that its preprocessing method converts the uploaded file to a temporary file, by @RussellLuo in PR 3660gr.Progress used in same function, by @space-nuko in PR 3671Remove All button in gr.Dropdown single-select mode by @space-nuko in PR 3678gr.Dropdown besides the selected item receiving a checkmark, by @space-nuko in PR 3644gr.Dropdown issues and improve usability, by @space-nuko in PR 3705HuggingFaceDatasetJSONSaver by @osanseviero in PR 3604Audio and State components, and fixes the pictionary demo by @abidlabs in PR 3611ruff, by @akx in PR 3710No changes to highlight.
orig_name to Video output in the backend so that the front end can set the right name for downloaded video files by @freddyaboulton in PR 3700No changes to highlight.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Once you have created a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! You can also download, reu
Once you have created a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! You can also download, reuse, and remix other peoples' themes. See https://gradio.app/theming-guide/ for more details.
By @freddyaboulton in PR 3428
gr.Code() component. By @abidlabs in PR 3556No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Restore label bars by @aliabid94 in PR 3507
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Nothing published for this version
Gradio now supports a new theme system, which allows you to customize the look and feel of your app. You can now use the theme= kwarg to pass in a pre
Gradio now supports a new theme system, which allows you to customize the look and feel of your app. You can now use the theme= kwarg to pass in a prebuilt theme, or customize your own! See https://gradio.app/theming-guide/ for more details. By @aliabid94 in PR 3470 and PR 3497
elem_classesAdd keyword argument elem_classes to Components to control class names of components, in the same manner as existing elem_id.
By @aliabid94 in PR 3466
gr.Request object failing to handle dictionaries when nested keys couldn't be converted to variable names #3454 by @radames in PR 3459pyright==1.1.298 for stability by @abidlabs in PR 3475IOComponent.add_interactive_to_config() by @space-nuko in PR 3476IOComponent.generate_sample() by @space-nuko in PR 3475No changes to highlight.
No changes to highlight.
You can now share your gradio themes with the world!
You can now share your gradio themes with the world!
After creating a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it!
There are two ways to upload a theme, via the theme class instance or the command line.
my_theme.push_to_hub(repo_name="my_theme",
version="0.2.0",
hf_token="...")
First save the theme to disk
my_theme.dump(filename="my_theme.json")
Then use the upload_theme command:
upload_theme\
"my_theme.json"\
"my_theme"\
"0.2.0"\
"<hf-token>"
The version must be a valid semantic version string.
This creates a space on the huggingface hub to host the theme files and show potential users a preview of your theme.
An example theme space is here: https://huggingface.co/spaces/freddyaboulton/dracula_revamped
To use a theme from the hub, use the from_hub method on the ThemeClass and pass it to your app:
my_theme = gr.Theme.from_hub("freddyaboulton/my_theme")
with gr.Blocks(theme=my_theme) as demo:
....
You can also pass the theme string directly to Blocks or Interface (gr.Blocks(theme="freddyaboulton/my_theme"))
You can pin your app to an upstream theme version by using semantic versioning expressions.
For example, the following would ensure the theme we load from the my_theme repo was between versions 0.1.0 and 0.2.0:
with gr.Blocks(theme="freddyaboulton/my_theme@>=0.1.0,<0.2.0") as demo:
....
by @freddyaboulton in PR 3428
New code component allows you to enter, edit and display code with full syntax highlighting by @pngwn in PR 3421
Chatbot component now supports audio, video, and imagesThe Chatbot component now supports audio, video, and images with a simple syntax: simply
pass in a tuple with the URL or filepath (the second optional element of the tuple is alt text), and the image/audio/video will be displayed:
gr.Chatbot([
(("driving.mp4",), "cool video"),
(("cantina.wav",), "cool audio"),
(("lion.jpg", "A lion"), "cool pic"),
]).style(height=800)
<img width="1054" alt="image" src="https://user-images.githubusercontent.com/1778297/224116682-5908db47-f0fa-405c-82ab-9c7453e8c4f1.png">
Note: images were previously supported via Markdown syntax and that is still supported for backwards compatibility. By @dawoodkhan82 in PR 3413
Allow consecutive function triggers with .then and .success by @aliabid94 in PR 3430
New code component allows you to enter, edit and display code with full syntax highlighting by @pngwn in PR 3421
.select() event listener, which also includes event data that can be passed as an argument to a function with type hint gr.SelectData. The following components support the .select() event listener: Chatbot, CheckboxGroup, Dataframe, Dropdown, File, Gallery, HighlightedText, Label, Radio, TabItem, Tab, Textbox. Example usage:import gradio as gr
with gr.Blocks() as demo:
gallery = gr.Gallery(["images/1.jpg", "images/2.jpg", "images/3.jpg"])
selected_index = gr.Textbox()
def on_select(evt: gr.SelectData):
return evt.index
gallery.select(on_select, None, selected_index)
By @aliabid94 in PR 3399
huggingface_hub to send telemetry on interface and blocks; eventually to replace segment by @dawoodkhan82 in PR 3342generic_update by shallow copying by @gitgithan in PR 3405 to fix #3282BlockContext in utils.py by @freddyaboulton in PR 3424No changes to highlight.
generic_update by shallow copying by @gitgithan in PR 3405 to fix #3282JSON component (show_label parameter, icons) in @abidlabs in PR 3451No changes to highlight.
Add height kwarg to style in gr.Chatbot() component by @dawoodkhan82 in PR 3369
height kwarg to style in gr.Chatbot() component by @dawoodkhan82 in PR 3369chatbot = gr.Chatbot().style(height=500)
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Now you can trigger your python function to run when the slider is released as opposed to every slider change value!
Now you can trigger your python function to run when the slider is released as opposed to every slider change value!
Simply use the release method on the slider
slider.release(function, inputs=[...], outputs=[...], api_name="predict")
By @freddyaboulton in PR 3353
The standard dropdown component now supports searching for choices. Also when multiselect is True, you can specify max_choices to set the maximum number of choices you want the user to be able to select from the dropdown component.
gr.Dropdown(label="Choose your favorite colors", choices=["red", "blue", "green", "yellow", "orange"], multiselect=True, max_choices=2)
by @dawoodkhan82 in PR 3211
Output images will now automatically have a download button displayed to make it easier to save and share the results of Machine Learning art models.
By @freddyaboulton in PR 3297
gr.Button component by setting interactive=False by @abidlabs in PR 3266 and PR 3288flagging_options display text and saved flag separately by @abidlabs in PR 3289brush_radius for the Image component both as a default and via Image.update() by @pngwn in PR 3277info= argument to form components to enable extra context provided to users, by @aliabid94 in PR 3291gr.Request() object using the .username attribute by @abidlabs in PR 3296preview option to Gallery.style that launches the gallery in preview mode when first loaded by @freddyaboulton in PR 3345mirror_webcam is always respected by @pngwn in PR 3245initial_height when loading is complete so the embed finds its natural height once it is loaded @pngwn in PR 3292shape argument on the front end when creating Image Sketches by @pngwn in PR 3277Dropdown's value to be [] and adding a change event on the dropdown by @freddyaboulton in PR 3295height set in Gallery.style was not respected by the front-end by @freddyaboulton in PR 3343gr.Dropdown(Multiselect=True) is an empty list and the initial value for gr.Dropdown(Multiselect=False) is an empty string by @pngwn in PR 3338analytics_enabled=True by @abidlabs in PR 3349types field to the dependency field in the config by @freddyaboulton in PR 3315gr.BarPlot
component by @abidlabs in PR 3275chatbot.style(color_map=) by [@aliabid94] in PR 3370No changes to highlight.
Nothing published for this version
Nothing published for this version
UI fixes including footer and API docs by @aliabid94 in PR 3242
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
When embedding a spaces-hosted gradio app as a web component, you now get an improved UI linking back to the original space, better error handling and
When embedding a spaces-hosted gradio app as a web component, you now get an improved UI linking back to the original space, better error handling and more intelligent load performance. No changes are required to your code to benefit from this enhanced experience; simply upgrade your gradio SDK to the latest version.
This behaviour is configurable. You can disable the info panel at the bottom by passing info="false". You can disable the container entirely by passing container="false".
Error statuses are reported in the UI with an easy way for end-users to report problems to the original space author via the community tab of that Hugginface space:
By default, gradio apps are lazy loaded, vastly improving performance when there are several demos on the page. Metadata is loaded ahead of time, but the space will only be loaded and rendered when it is in view.
This behaviour is configurable. You can pass eager="true" to load and render the space regardless of whether or not it is currently on the screen.
gr.BarPlot component! 📊Create interactive bar plots from a high-level interface with gr.BarPlot.
No need to remember matplotlib syntax anymore!
Example usage:
import gradio as gr
import pandas as pd
simple = pd.DataFrame({
'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
with gr.Blocks() as demo:
gr.BarPlot(
simple,
x="a",
y="b",
title="Simple Bar Plot with made up data",
tooltip=['a', 'b'],
)
demo.launch()
By @freddyaboulton in PR 3157
Fixed a bug that prevented bokeh plots from being displayed on the front end and extended support for both 2.x and 3.x versions of bokeh!
By @freddyaboulton in PR 3212
None as the second value in the tuple, to add a single message in the chatbot from the "bot" side.gr.Chatbot([("Hi, I'm DialoGPT. Try asking me a question.", None)])
By @dawoodkhan82 in PR 3165
gr.utils.delete_none to only remove props whose values are None from the config by @abidlabs in PR 3188change event is now triggered when users click the 'Clear All' button of the multiselect DropDown component by @freddyaboulton in PR 3195clear event is now triggered when images are cleared by @freddyaboulton in PR 3218No changes to highlight.
No changes to highlight.
File component or UploadButton component includes a file_types parameter along with file_count=="dir") by @abidlabs in PR 3194gr.Error instead of a regular Python error when you use gr.Interface.load() to load a model and there's an error querying the HF API by @abidlabs in PR 3194No changes to highlight.
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
Nothing published for this version
Nothing published for this version
If your Interface function is a generator, there used to be a separate Stop button displayed next to the Submit button.
If your Interface function is a generator, there used to be a separate Stop button displayed next
to the Submit button.
We've revamed the Submit button so that it turns into a Stop button during the generation process.
Clicking on the Stop button will cancel the generation and turn it back to a Submit button.
The Stop button will automatically turn back to a Submit button at the end of the generation if you don't use it!
By @freddyaboulton in PR 3124
You can now call queue on your demo outside of the if __name__ == "__main__" block and
run the script in reload mode with the gradio command.
Any changes to the app.py file will be reflected in the webpage automatically and the queue will work
properly!
By @freddyaboulton in PR 3089
demo = gr.Interface(...)
demo.launch(
file_directories=["/var/lib/demo/path/to/resources"]
)
By @maxaudron in PR 3075
Column) by @abidlabs in PR 3123Interface via the %%blocks jupyter notebook magic command by @freddyaboulton in PR 3126launch will not be respected when using reload mode, e.g. gradio command by @freddyaboulton in PR 3089equal_height parameter should be passed to the .style() method of gr.Row() by @freddyaboulton in PR 3125No changes to highlight.
No changes to highlight.
fake_diffusion demos by @freddyaboulton in PR 3120No changes to highlight.
Previously photos uploaded via iOS would be rotated after processing. This has been fixed by @freddyaboulton in PR 3089
Previously photos uploaded via iOS would be rotated after processing. This has been fixed by @freddyaboulton in PR 3089
######### Before
######### After
A share link will automatically be created when running on Kaggle kernels (notebooks) so that the front-end is properly displayed.
By @freddyaboulton in PR 3101
Gallery.style(grid=...) by by @aliabd in PR 3107No changes to highlight.
No changes to highlight.
markdown-it-py version to 2.0.0 so that the dollar math plugin is compatible by @freddyaboulton in PR 3102No changes to highlight.
Nothing published for this version
Nothing published for this version
Fix bug related to deprecated parameters in huggingface_hub for the HuggingFaceDatasetSaver in PR 3025
You can now load image-to-text and conversational pipelines from the hub!
io = gr.Interface.load("models/nlpconnect/vit-gpt2-image-captioning",
api_key="<optional-api-key>")
io.launch()
<img width="1087" alt="image" src="https://user-images.githubusercontent.com/41651716/213260197-dc5d80b4-6e50-4b3a-a764-94980930ac38.png">
chatbot = gr.Interface.load("models/microsoft/DialoGPT-medium",
api_key="<optional-api-key>")
chatbot.launch()
By @freddyaboulton in PR 3011
No need for an additional file output component to enable model3d file downloads anymore. We now added a download button to the model3d component itself.
<img width="739" alt="Screenshot 2023-01-18 at 3 52 45 PM" src="https://user-images.githubusercontent.com/12725292/213294198-5f4fda35-bde7-450c-864f-d5683e7fa29a.png">
By @dawoodkhan82 in PR 3014
Authentication on spaces works now! Third party cookies must be enabled on your browser to be able to log in. Some browsers disable third party cookies by default (Safari, Chrome Incognito).
/file/ route that was broken in a recent change in PR 3010huggingface_hub for the HuggingFaceDatasetSaver in PR 3025closed app by @freddyaboulton in PR 3022file_types parameter of gr.File or gr.UploadButton was not a list by @freddyaboulton in PR 3048UploadButton by @freddyaboulton in PR 3053gr.LinePlot for the blocks_kinematics demo by @freddyaboulton in PR 2998interface_series_load to include some inline markdown code by @abidlabs in PR 3051No changes to highlight.
No changes to highlight.
Fixed file upload fails for files with zero size by @dawoodkhan82 in PR 2923
No changes to highlight.
mount_gradio_app would not launch if the queue was enabled in a gradio app by @freddyaboulton in PR 2939blocks_plug demo that prevented switching tabs programmatically with python @TashaSkyUp in PR 2971.No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Fix audio file output by @aliabid94 in PR 2950.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Nothing published for this version
```python def reverse(word, progress=gr.Progress()): progress(0, desc="Starting") time.sleep(1) new_string = "" for letter in progress.tqdm(word, desc
gr.Progress argument after the input arguments to any function. Example:def reverse(word, progress=gr.Progress()):
progress(0, desc="Starting")
time.sleep(1)
new_string = ""
for letter in progress.tqdm(word, desc="Reversing"):
time.sleep(0.25)
new_string = letter + new_string
return new_string
demo = gr.Interface(reverse, gr.Text(), gr.Text())
Progress indicator bar by @aliabid94 in PR 2750.
title argument to TabbedInterface by @MohamedAliRashad in #2888gr.File and gr.UploadButton, using file_types parameter (e.g gr.File(file_count="multiple", file_types=["text", ".json", ".csv"])) by @dawoodkhan82 in #2901multiselect option to Dropdown by @dawoodkhan82 in #2871multiselect set to true a user can now select multiple options from the gr.Dropdown component.gr.Dropdown(["angola", "pakistan", "canada"], multiselect=True, value=["angola"])
<img width="610" alt="Screenshot 2023-01-03 at 4 14 36 PM" src="https://user-images.githubusercontent.com/12725292/210442547-c86975c9-4b4f-4b8e-8803-9d96e6a8583a.png">
default_enabled=False made it so that the entire queue did not start by @freddyaboulton in PR 2876blocks_style demo that was preventing it from launching by @freddyaboulton in PR 2890DataFrame and LinePlot component, by @abidlabs in PR 2816No changes to highlight.
default_enabled parameter of the Blocks.queue method has no effect by @freddyaboulton in PR 2876Gradio's newest plotting component gr.LinePlot! 📈
Gradio's newest plotting component gr.LinePlot! 📈
With this component you can easily create time series visualizations with customizable appearance for your demos and dashboards ... all without having to know an external plotting library.
For an example of the api see below:
gr.LinePlot(stocks,
x="date",
y="price",
color="symbol",
color_legend_position="bottom",
width=600, height=400, title="Stock Prices")
By @freddyaboulton in PR 2807
examples_per_page parameter of the Examples component was not passed to the internal Dataset component by @freddyaboulton in PR 2861allow_flagging="auto" in gr.Interface() by @abidlabs in PR 2695gr.CheckboxGroup would crash the entire app by @freddyaboulton in PR 2866DataFrame and ScatterPlot component,
by @abidlabs in PR 2794No changes to highlight.
No changes to highlight.
[@aliencaocao](https://github.com/aliencaocao) in [PR 2846](https://github.com/gradio-app/gradio/pull/2846)x_lim, y_lim and legend positions for gr.ScatterPlot by @freddyaboulton in PR 2807No changes to highlight.
Adds a gr.make_waveform() function that creates a waveform video by combining an audio and an optional background image by @dawoodkhan82 and @aliabid9
Adds a gr.make_waveform() function that creates a waveform video by combining an audio and an optional background image by @dawoodkhan82 and @aliabid94 in [PR 2706](https://github.com/gradio-app/gradio/pull/2706. Helpful for making audio outputs much more shareable.
every ParameterWhen a component's initial value is a function, the every parameter re-runs the function every every seconds. By @abidlabs in PR 2806. Here's a code example:
import gradio as gr
with gr.Blocks() as demo:
df = gr.DataFrame(run_query, every=60*60)
demo.queue().launch()
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Nothing published for this version
Improves documentation of several queuing-related parameters by @abidlabs in PR 2825
No changes to highlight.
*No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Replaces tunneling logic based on ssh port-forwarding to that based on frp by XciD and Wauplin in PR 2509
Replaces tunneling logic based on ssh port-forwarding to that based on frp by XciD and Wauplin in PR 2509
You don't need to do anything differently, but when you set share=True in launch(),
you'll get this message and a public link that look a little bit different:
Setting up a public link... we have recently upgraded the way public links are generated. If you encounter any problems, please downgrade to gradio version 3.13.0
.
Running on public URL: https://bec81a83-5b5c-471e.gradio.live
These links are a more secure and scalable way to create shareable demos!
gr.Dataframe() to take a pandas.DataFrame that includes numpy array and other types as its initial value, by @abidlabs in PR 2804altair to requirements.txt by @freddyaboulton in PR 2811No changes to highlight.
visible in classes in templates.py by @abidlabs in PR 2805https://api.ipify.org to https://checkip.amazonaws.com/ by @abidlabs in PR 2810No changes to highlight.
Nothing published for this version
Nothing published for this version
Nothing published for this version
It is now possible to create a scatter plot natively in Gradio!
It is now possible to create a scatter plot natively in Gradio!
The gr.ScatterPlot component accepts a pandas dataframe and some optional configuration parameters
and will automatically create a plot for you!
This is the first of many native plotting components in Gradio!
For an example of how to use gr.ScatterPlot see below:
import gradio as gr
from vega_datasets import data
cars = data.cars()
with gr.Blocks() as demo:
gr.ScatterPlot(show_label=False,
value=cars,
x="Horsepower",
y="Miles_per_Gallon",
color="Origin",
tooltip="Name",
title="Car Data",
y_title="Miles per Gallon",
color_legend_title="Origin of Car").style(container=False)
demo.launch()
<img width="404" alt="image" src="https://user-images.githubusercontent.com/41651716/206737726-4c4da5f0-dee8-4f0a-b1e1-e2b75c4638e9.png">
By @freddyaboulton in PR 2764
The Plot component can now accept altair plots as values!
Simply return an altair plot from your event listener and gradio will display it in the front-end.
See the example below:
import gradio as gr
import altair as alt
from vega_datasets import data
cars = data.cars()
chart = (
alt.Chart(cars)
.mark_point()
.encode(
x="Horsepower",
y="Miles_per_Gallon",
color="Origin",
)
)
with gr.Blocks() as demo:
gr.Plot(value=chart)
demo.launch()
<img width="1366" alt="image" src="https://user-images.githubusercontent.com/41651716/204660697-f994316f-5ca7-4e8a-93bc-eb5e0d556c91.png">
By @freddyaboulton in PR 2741
The Label component now accepts a color argument by @freddyaboulton in PR 2736.
The color argument should either be a valid css color name or hexadecimal string.
You can update the color with gr.Label.update!
This lets you create Alert and Warning boxes with the Label component. See below:
import gradio as gr
import random
def update_color(value):
if value < 0:
# This is bad so use red
return "#FF0000"
elif 0 <= value <= 20:
# Ok but pay attention (use orange)
return "#ff9966"
else:
# Nothing to worry about
return None
def update_value():
choice = random.choice(['good', 'bad', 'so-so'])
color = update_color(choice)
return gr.Label.update(value=choice, color=color)
with gr.Blocks() as demo:
label = gr.Label(value=-10)
demo.load(lambda: update_value(), inputs=None, outputs=[label], every=1)
demo.queue().launch()
Add Brazilian Portuguese translation (pt-BR.json) by @pstwh in PR 2753:
<img width="951" alt="image" src="https://user-images.githubusercontent.com/1778297/206615305-4c52031e-3f7d-4df2-8805-a79894206911.png">
No changes to highlight.
No changes to highlight.
No changes to highlight.
gr.Blocks().load() by @abidlabs in PR 2755No changes to highlight.
Nothing published for this version
You can now pass in some Markdown to the Chatbot component and it will show up, meaning that you can pass in images as well! by @abidlabs in PR 2731
Chatbot component now supports a subset of Markdown (including bold, italics, code, images)You can now pass in some Markdown to the Chatbot component and it will show up, meaning that you can pass in images as well! by @abidlabs in PR 2731
Here's a simple example that references a local image lion.jpg that is in the same
folder as the Python script:
import gradio as gr
with gr.Blocks() as demo:
gr.Chatbot([("hi", "hello **abubakar**"), ("", "cool pic")])
demo.launch()
To see a more realistic example, see the new demo /demo/chatbot_multimodal/run.py.
Added mathtext (a subset of latex) support to gr.Markdown. Added by @kashif and @aliabid94 in PR 2696.
Example of how it can be used:
gr.Markdown(
r"""
# Hello World! $\frac{\sqrt{x + y}}{4}$ is today's lesson.
""")
You can now update the Accordion label and open status with gr.Accordion.update by @freddyaboulton in PR 2690
import gradio as gr
with gr.Blocks() as demo:
with gr.Accordion(label="Open for greeting", open=False) as accordion:
gr.Textbox("Hello!")
open_btn = gr.Button(value="Open Accordion")
close_btn = gr.Button(value="Close Accordion")
open_btn.click(
lambda: gr.Accordion.update(open=True, label="Open Accordion"),
inputs=None,
outputs=[accordion],
)
close_btn.click(
lambda: gr.Accordion.update(open=False, label="Closed Accordion"),
inputs=None,
outputs=[accordion],
)
demo.launch()
File component can properly preprocess files to "binary" byte-string format by CoffeeVampir3 in PR 2727No changes to highlight.
No changes to highlight.
include_audio in Video component. When True, for source="webcam" this will record audio and video, for source="upload" this will retain the audio in an uploaded video by @mandargogate in PR 2721Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →