gradio / js /app /CHANGELOG.md
mindmime's picture
Upload folder using huggingface_hub
a03b3ba verified

A newer version of the Gradio SDK is available: 4.38.1

Upgrade

@gradio/app

1.22.0

Features

Fixes

1.21.0

Highlights

Custom component documentation generator (#7030 3a944ed)

If your custom component has type hints and docstrings for both parameters and return values, you can now automatically generate a documentation page and README.md with no additional effort. Simply run the following command:

gradio cc docs

This will generate a Gradio app that you can upload to spaces providing rich documentation for potential users. The documentation page includes:

  • Installation instructions.
  • A live embedded demo and working code snippet, pulled from your demo app.
  • An API reference for initialising the component, with types, default values and descriptions.
  • An explanation of how the component affects the user's predict function inputs and outputs.
  • Any additional interfaces or classes that are necessary to understand the API reference.
  • Optional links to GitHub, PyPi, and Hugging Face Spaces.

A README will also be generated detailing the same information but in a format that is optimised for viewing on GitHub or PyPi!

Thanks @pngwn!

1.20.0

Features

Fixes

1.19.0

Features

1.18.0

Features

Fixes

  • #6863 d406855 - Fix JS Client when app is running behind a proxy. Thanks @freddyaboulton!
  • #6846 48d6534 - Add show_api parameter to events, and fix gr.load(). Also makes some minor improvements to the "view API" page when running on Spaces. Thanks @abidlabs!

1.17.0

Features

Fixes

1.16.2

Patch Changes

1.16.1

Patch Changes

1.16.0

Features

Fixes

1.15.0

Features

1.14.0

Features

Fixes

1.13.1

Fixes

1.13.0

Highlights

New ImageEditor component (#6169 9caddc17b)

A brand new component, completely separate from Image that provides simple editing capabilities.

  • Set background images from file uploads, webcam, or just paste!
  • Crop images with an improved cropping UI. App authors can event set specific crop size, or crop ratios (1:1, etc)
  • Paint on top of any image (or no image) and erase any mistakes!
  • The ImageEditor supports layers, confining draw and erase actions to that layer.
  • More flexible access to data. The image component returns a composite image representing the final state of the canvas as well as providing the background and all layers as individual images.
  • Fully customisable. All features can be enabled and disabled. Even the brush color swatches can be customised.


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!

1.12.0

Features

Fixes

1.11.0

Features

Fixes

1.10.3

Patch Changes

1.10.2

Patch Changes

1.10.1

Patch Changes

1.10.0

Features

Fixes

1.9.2

Fixes

1.9.1

Features

1.9.0

Features

Fixes

1.9.0-beta.3

Features

1.9.0-beta.2

Features

Fixes

1.9.0-beta.1

Patch Changes

1.9.0-beta.0

Features

  • #5960 319c30f3f - rererefactor frontend files. Thanks @pngwn!
  • #5956 f769876e0 - Apply formatter (and small refactoring) to the Lite-related frontend code. Thanks @whitphx!
  • #5498 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!

Fixes

1.8.0

Features

  • #5627 b67115e8e - Lite: Make the Examples component display media files using pseudo HTTP requests to the Wasm server. Thanks @whitphx!
  • #5886 121f25b2d - Lite: Fix is_self_host() to detect 127.0.0.1 as localhost as well. Thanks @whitphx!

1.7.1

Patch Changes

1.7.0

Highlights

new FileExplorer component (#5672 e4a307ed6)

Thanks to a new capability that allows components to communicate directly with the server without passing data via the value, we have created a new FileExplorer component.

This component allows you to populate the explorer by passing a glob, but only provides the selected file(s) in your prediction function.

Users can then navigate the virtual filesystem and select files which will be accessible in your predict function. This component will allow developers to build more complex spaces, with more flexible input options.

output

For more information check the FileExplorer documentation.

Thanks @aliabid94!

Fixes

1.6.4

Features

1.6.3

Patch Changes

1.6.2

Features

Fixes

1.6.1

Patch Changes

1.6.0

Features

1.5.4

Features

1.5.3

Fixes

1.5.2

Patch Changes

1.5.1

Patch Changes

1.5.0

Features

1.4.3

Patch Changes

1.4.2

Fixes

1.4.1

Patch Changes

1.4.0

Features

1.3.2

Patch Changes

1.3.1

Fixes

1.3.0

Highlights

Improve startup performance and markdown support (#5279 fe057300)

Improved markdown support

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.

Various performance improvements

These improvements will be particularly beneficial to large applications.

  • Rather than attaching events manually, they are now delegated, leading to a significant performance improvement and addressing a performance regression introduced in a recent version of Gradio. App startup for large applications is now around twice as fast.
  • Optimised the mounting of individual components, leading to a modest performance improvement during startup (~30%).
  • Corrected an issue that was causing markdown to re-render infinitely.
  • Ensured that the gr.3DModel does re-render prematurely.

Thanks @pngwn!

Add render function to <gradio-app> (#5158 804fcc05)

We now have an event render on the 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!

Features

  • #5215 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!
  • #5216 4b58ea6d - Update i18n tokens and locale files. Thanks @hannahblair!
  • #5219 e8fd4e4e - Add api_name parameter to gr.Interface. Additionally, completely hide api page if show_api=False. Thanks @freddyaboulton!
  • #5264 46a2b600 - ensure translations for audio work correctly. Thanks @hannahblair!

Fixes

1.2.0

Highlights

Client.predict will now return the final output for streaming endpoints (#5057 35856f8b)

This is a breaking change (for gradio_client only)!

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!

Features

1.1.0

Features