hd0013's picture
Upload folder using huggingface_hub
8fdc036 verified

A newer version of the Gradio SDK is available: 4.37.2

Upgrade

@gradio/client

0.19.3

Features

  • #8229 7c81897 - chore(deps): update dependency esbuild to ^0.21.0. Thanks @renovate!

Fixes

  • #8296 929d216 - always create a jwt when connecting to a space if a hf_token is present. Thanks @pngwn!

0.19.2

Fixes

  • #8285 7d9d8ea - use the correct query param to pass the jwt to the heartbeat event. Thanks @pngwn!

0.19.1

Fixes

  • #8272 fbf4edd - ensure client works for private spaces. Thanks @pngwn!

0.19.0

Features

  • #8110 5436031 - Render decorator 2. Thanks @aliabid94!
  • #8197 e09b4e8 - Add support for passing keyword args to data in JS client. Thanks @hannahblair!

Fixes

0.18.0

Features

  • #8121 f5b710c - chore(deps): update dependency eslint to v9. Thanks @renovate!
  • #8209 b9afe93 - Rename eventSource_Factory and fetch_implementation. Thanks @hannahblair!
  • #8109 bed2f82 - Implement JS Client tests. Thanks @hannahblair!
  • #8211 91b5cd6 - remove redundant event source logic. Thanks @hannahblair!

Fixes

  • #8179 6a218b4 - rework upload to be a class method + pass client into each component. Thanks @pngwn!
  • #8181 cf52ca6 - Ensure connectivity to private HF spaces with SSE protocol. Thanks @hannahblair!
  • #8169 3a6f1a5 - Only connect to heartbeat if needed. Thanks @freddyaboulton!
  • #8118 7aca673 - Add eventsource polyfill for Node.js and browser environments. Thanks @hannahblair!

0.17.0

Highlights

Setting File Upload Limits (#7909 2afca65)

We have added a max_file_size size parameter to launch() that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).

The following code snippet sets a max file size of 5 megabytes.

import gradio as gr

demo = gr.Interface(lambda x: x, "image", "image")

demo.launch(max_file_size="5mb")
# or
demo.launch(max_file_size=5 * gr.FileSize.MB)

max_file_size_upload

Error states can now be cleared

When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the x icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.

error_modal_calculator

Thanks @freddyaboulton!

Features

  • #8056 2e469a5 - Using keys to preserve values between reloads. Thanks @aliabid94!
  • #7646 450b8cc - Refactor JS Client. Thanks @hannahblair!
  • #8061 17e83c9 - Docs Reorg and Intro Page. Thanks @aliabd!

Fixes

  • #8066 624f9b9 - make gradio dev tools a local dependency rather than bundling. Thanks @pngwn!

0.16.0

Features

  • #7845 dbb7373 - ensure ImageEditor events work as expected. Thanks @pngwn!

Fixes

  • #7974 79e0aa8 - Fix heartbeat in the js client to be Lite compatible. Thanks @whitphx!

0.15.1

Fixes

  • #7926 9666854 - Fixes streaming event race condition. Thanks @aliabid94!

0.15.0

Highlights

Automatically delete state after user has disconnected from the webpage (#7829 6a4bf7a)

Gradio now automatically deletes gr.State variables stored in the server's RAM when users close their browser tab. The deletion will happen 60 minutes after the server detected a disconnect from the user's browser. If the user connects again in that timeframe, their state will not be deleted.

Additionally, Gradio now includes a Blocks.unload() event, allowing you to run arbitrary cleanup functions when users disconnect (this does not have a 60 minute delay). You can think of the unload event as the opposite of the load event.

with gr.Blocks() as demo:
    gr.Markdown(
"""# State Cleanup Demo
🖼️ Images are saved in a user-specific directory and deleted when the users closes the page via demo.unload.
""")
    with gr.Row():
        with gr.Column(scale=1):
            with gr.Row():
                img = gr.Image(label="Generated Image", height=300, width=300)
            with gr.Row():
                gen = gr.Button(value="Generate")
            with gr.Row():
                history = gr.Gallery(label="Previous Generations", height=500, columns=10)
                state = gr.State(value=[], delete_callback=lambda v: print("STATE DELETED"))

    demo.load(generate_random_img, [state], [img, state, history]) 
    gen.click(generate_random_img, [state], [img, state, history])
    demo.unload(delete_directory)


demo.launch(auth=lambda user,pwd: True,
            auth_message="Enter any username and password to continue")

Thanks @freddyaboulton!

0.14.0

Features

  • #7691 84f81fe - Closing stream from the backend. Thanks @aliabid94!

Fixes

  • #7564 5d1e8da - batch UI updates on a per frame basis. Thanks @pngwn!

0.13.0

Fixes

  • #7575 d0688b3 - Files should now be supplied as file(...) in the Client, and some fixes to gr.load() as well. Thanks @abidlabs!

0.12.2

Features

0.12.1

Fixes

  • #7411 32b317f - Set root correctly for Gradio apps that are deployed behind reverse proxies. Thanks @abidlabs!

0.12.0

Features

  • #7183 49d9c48 - [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks @abidlabs!

0.11.0

Features

  • #7102 68a54a7 - Improve chatbot streaming performance with diffs. Thanks @aliabid94!/n Note that this PR changes the API format for generator functions, which would be a breaking change for any clients reading the EventStream directly

0.10.1

Fixes

0.10.0

Features

0.9.4

Fixes

0.9.3

Features

  • #6814 828fb9e - Refactor queue so that there are separate queues for each concurrency id. Thanks @aliabid94!

0.9.2

Features

0.9.1

Fixes

  • #6693 34f9431 - Python client properly handles hearbeat and log messages. Also handles responses longer than 65k. Thanks @freddyaboulton!

0.9.0

Features

Fixes

0.8.2

Features

  • #6511 71f1a1f99 - Mark FileData.orig_name optional on the frontend aligning the type definition on the Python side. Thanks @whitphx!

0.8.1

Fixes

0.8.0

Features

0.7.2

Fixes

0.7.1

Features

0.7.0

Features

0.7.0-beta.1

Features

0.7.0-beta.0

Features

Fixes

0.6.0

Features

  • #5972 11a300791 - Lite: Support opening the entrypoint HTML page directly in browser via the file: protocol. Thanks @whitphx!

0.5.2

Fixes

  • #5840 4e62b8493 - Ensure websocket polyfill doesn't load if there is already a global.Webocket property set. Thanks @Jay2theWhy!

0.5.1

Fixes

0.5.0

Highlights

new FileExplorer component (#5672 e4a307ed6)

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

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

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

output

For more information check the FileExplorer documentation.

Thanks @aliabid94!

Features

  • #5787 caeee8bf7 - ensure the client does not depend on window when running in a node environment. Thanks @gibiee!

Fixes

0.4.2

Features

0.4.1

Fixes

  • #5705 78e7cf516 - ensure internal data has updated before dispatching success or then events. Thanks @pngwn!

0.4.0

Features

0.3.1

Fixes

0.3.0

Features

0.2.1

Features

0.2.0

Features

Fixes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

  • #4201 da5b4ee1 Thanks @pngwn! - Ensure semiver is bundled so CDN links work correctly.

  • #4202 a26e9afd Thanks @pngwn! - Ensure all URLs returned by the client are complete URLs with the correct host instead of an absolute path relative to a server.

0.1.0

Minor Changes

Patch Changes