github gradio-app/gradio v3.12.0

latest releases: @gradio/uploadbutton@0.6.13, @gradio/video@0.9.1, @gradio/upload@0.11.4...
19 months ago

3.12.0

New Features:

The 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**"), ("![](/file=lion.jpg)", "cool pic")])
    
demo.launch()

Alt text

To see a more realistic example, see the new demo /demo/chatbot_multimodal/run.py.

Latex support

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.
    """)

Update Accordion properties from the backend

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()

update_accordion

Bug Fixes:

  • Fixed bug where requests timeout is missing from utils.version_check() by @yujiehecs in PR 2729
  • Fixed bug where so that the File component can properly preprocess files to "binary" byte-string format by CoffeeVampir3 in PR 2727
  • Fixed bug to ensure that filenames are less than 200 characters even for non-English languages by @SkyTNT in PR 2685

Documentation Changes:

Testing and Infrastructure Changes:

No changes to highlight.

Breaking Changes:

No changes to highlight.

Full Changelog:

Contributors Shoutout:

Don't miss a new gradio release

NewReleases is sending notifications on new releases.