2023-07-27 05:10:24 +08:00
# @gradio/upload
2024-04-03 01:33:48 +08:00
## 0.8.3
### Dependency updates
- @gradio/upload@0 .8.3
- @gradio/client@0 .15.0
2024-03-28 05:25:36 +08:00
## 0.8.2
### Fixes
- [#7848 ](https://github.com/gradio-app/gradio/pull/7848 ) [`8d7b3ca` ](https://github.com/gradio-app/gradio/commit/8d7b3caebd8f95b1372f8412cadbb5862766c365 ) - Multimodal Textbox Loading + other fixes. Thanks @dawoodkhan82 !
### Dependency updates
- @gradio/atoms@0 .6.1
- @gradio/icons@0 .3.4
- @gradio/upload@0 .8.2
2024-03-26 00:35:44 +08:00
## 0.8.1
### Dependency updates
- @gradio/upload@0 .8.1
- @gradio/wasm@0 .10.0
- @gradio/atoms@0 .6.0
2024-03-20 04:50:31 +08:00
## 0.8.0
### Features
- [#7420 ](https://github.com/gradio-app/gradio/pull/7420 ) [`15da39f` ](https://github.com/gradio-app/gradio/commit/15da39fca01d09a30cf47e7e72d7efa5052f61f8 ) - Multimodal Textbox (Chat Input Component). Thanks @dawoodkhan82 !
### Dependency updates
- @gradio/client@0 .14.0
- @gradio/upload@0 .8.0
- @gradio/wasm@0 .9.0
2024-03-09 08:35:23 +08:00
## 0.7.7
### Dependency updates
- @gradio/upload@0 .7.7
- @gradio/client@0 .13.0
- @gradio/wasm@0 .8.0
2024-03-07 01:13:41 +08:00
## 0.7.6
### Features
- [#7625 ](https://github.com/gradio-app/gradio/pull/7625 ) [`8181695` ](https://github.com/gradio-app/gradio/commit/8181695e70187e8bc2bf7518697098c8d1b9843d ) - image upload fix. Thanks [@dawoodkhan82 ](https://github.com/dawoodkhan82 )!
2024-03-06 08:54:36 +08:00
## 0.7.5
### Fixes
- [#7559 ](https://github.com/gradio-app/gradio/pull/7559 ) [`26356a6` ](https://github.com/gradio-app/gradio/commit/26356a623c4196f48ca236d973a597831743cdb8 ) - Fixes: Invalid file_type breaks drag and drop. Thanks [@dawoodkhan82 ](https://github.com/dawoodkhan82 )!
2024-02-17 04:28:13 +08:00
## 0.7.4
### Patch Changes
- Updated dependencies [[`f191786` ](https://github.com/gradio-app/gradio/commit/f1917867916647d383b8d7ce15e0c17f2abbdec1 )]:
- @gradio/icons@0 .3.3
- @gradio/atoms@0 .5.3
- @gradio/upload@0 .7.4
2024-02-15 06:17:50 +08:00
## 0.7.3
### Patch Changes
- Updated dependencies [[`065c5b1` ](https://github.com/gradio-app/gradio/commit/065c5b163c4badb9d9cbd06d627fb4ba086003e7 ), [`32b317f` ](https://github.com/gradio-app/gradio/commit/32b317f24e3d43f26684bb9f3964f31efd0ea556 )]:
- @gradio/utils@0 .3.0
- @gradio/client@0 .12.1
- @gradio/atoms@0 .5.2
- @gradio/upload@0 .7.3
2024-02-10 14:15:34 +08:00
## 0.7.2
### Patch Changes
- Updated dependencies [[`49d9c48` ](https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6 )]:
- @gradio/client@0 .12.0
- @gradio/upload@0 .7.2
2024-02-07 07:19:29 +08:00
## 0.7.1
### Features
2024-02-10 14:15:34 +08:00
- [#7206 ](https://github.com/gradio-app/gradio/pull/7206 ) [`572e360` ](https://github.com/gradio-app/gradio/commit/572e360fff4a03c335b86e1a7517a44cb6af2bcd ) - Upload tweak. Thanks [@pngwn ](https://github.com/pngwn )!
2024-02-07 07:19:29 +08:00
### Fixes
2024-02-10 14:15:34 +08:00
- [#7141 ](https://github.com/gradio-app/gradio/pull/7141 ) [`c3e61e4` ](https://github.com/gradio-app/gradio/commit/c3e61e4f70696a71aede67b65d28447eb67daf16 ) - Few File component drag and drop. Thanks [@dawoodkhan82 ](https://github.com/dawoodkhan82 )!
2024-02-07 07:19:29 +08:00
2024-01-26 08:10:24 +08:00
## 0.7.0
### Features
2024-02-10 14:15:34 +08:00
- [#7104 ](https://github.com/gradio-app/gradio/pull/7104 ) [`bc2cdc1` ](https://github.com/gradio-app/gradio/commit/bc2cdc1df95b38025486cf76df4a494b66d98585 ) - Allow download button for interactive Audio and Video components. Thanks [@hannahblair ](https://github.com/hannahblair )!
2024-01-26 08:10:24 +08:00
2024-01-19 13:13:02 +08:00
## 0.6.1
### Fixes
2024-02-10 14:15:34 +08:00
- [#6982 ](https://github.com/gradio-app/gradio/pull/6982 ) [`3f139c7` ](https://github.com/gradio-app/gradio/commit/3f139c7c995f749562bb007d2a567bb167669de9 ) - Fix File drag and drop for specific file_types. Thanks [@dawoodkhan82 ](https://github.com/dawoodkhan82 )!
2024-01-19 13:13:02 +08:00
2024-01-11 05:42:25 +08:00
## 0.6.0
### Features
2024-02-10 14:15:34 +08:00
- [#6965 ](https://github.com/gradio-app/gradio/pull/6965 ) [`5d00dd3` ](https://github.com/gradio-app/gradio/commit/5d00dd37ca14bbfef2ceac550b29dbe05ba8cab0 ) - Make < UploadProgress /> Wasm-compatible. Thanks [@whitphx ](https://github.com/whitphx )!
2024-01-11 05:42:25 +08:00
### Fixes
2024-02-10 14:15:34 +08:00
- [#6969 ](https://github.com/gradio-app/gradio/pull/6969 ) [`793bf8f` ](https://github.com/gradio-app/gradio/commit/793bf8f7b1943f265c5d016c1a0c682ee549232a ) - Display pending file in `<Upload />` while waiting for upload request. Thanks [@hannahblair ](https://github.com/hannahblair )!
2024-01-11 05:42:25 +08:00
2024-01-05 08:02:25 +08:00
## 0.5.8
### Features
2024-02-10 14:15:34 +08:00
- [#6931 ](https://github.com/gradio-app/gradio/pull/6931 ) [`6c863af` ](https://github.com/gradio-app/gradio/commit/6c863af92fa9ceb5c638857eb22cc5ddb718d549 ) - Fix functional tests. Thanks [@aliabid94 ](https://github.com/aliabid94 )!
2024-01-05 08:02:25 +08:00
2023-12-23 05:05:17 +08:00
## 0.5.7
### Patch Changes
- Updated dependencies [[`d406855` ](https://github.com/gradio-app/gradio/commit/d4068557953746662235d595ec435c42ceb24414 )]:
- @gradio/client@0 .9.4
- @gradio/upload@0 .5.7
2023-12-20 08:17:10 +08:00
## 0.5.6
### Fixes
2023-12-23 05:05:17 +08:00
- [#6766 ](https://github.com/gradio-app/gradio/pull/6766 ) [`73268ee` ](https://github.com/gradio-app/gradio/commit/73268ee2e39f23ebdd1e927cb49b8d79c4b9a144 ) - Improve source selection UX. Thanks [@hannahblair ](https://github.com/hannahblair )!
2023-12-20 08:17:10 +08:00
2023-12-16 07:39:46 +08:00
## 0.5.5
### Patch Changes
- Updated dependencies [[`245d58e` ](https://github.com/gradio-app/gradio/commit/245d58eff788e8d44a59d37a2d9b26d0f08a62b4 )]:
- @gradio/client@0 .9.2
- @gradio/upload@0 .5.5
2023-12-15 05:14:57 +08:00
## 0.5.4
### Fixes
2023-12-16 07:39:46 +08:00
- [#6525 ](https://github.com/gradio-app/gradio/pull/6525 ) [`5d51fbc` ](https://github.com/gradio-app/gradio/commit/5d51fbce7826da840a2fd4940feb5d9ad6f1bc5a ) - Fixes Drag and Drop for Upload. Thanks [@dawoodkhan82 ](https://github.com/dawoodkhan82 )!
2023-12-15 05:14:57 +08:00
2023-12-13 10:32:54 +08:00
## 0.5.3
### Fixes
2023-12-16 07:39:46 +08:00
- [#6709 ](https://github.com/gradio-app/gradio/pull/6709 ) [`6a9151d` ](https://github.com/gradio-app/gradio/commit/6a9151d5c9432c724098da7d88a539aaaf5ffe88 ) - Remove progress animation on streaming. Thanks [@aliabid94 ](https://github.com/aliabid94 )!
2023-12-13 10:32:54 +08:00
2023-12-05 08:14:12 +08:00
## 0.5.2
### Patch Changes
- Updated dependencies [[`206af31` ](https://github.com/gradio-app/gradio/commit/206af31d7c1a31013364a44e9b40cf8df304ba50 )]:
- @gradio/icons@0 .3.1
- @gradio/atoms@0 .3.1
- @gradio/upload@0 .5.2
2023-11-23 07:43:10 +08:00
## 0.5.1
### Patch Changes
- Updated dependencies [[`71f1a1f99` ](https://github.com/gradio-app/gradio/commit/71f1a1f9931489d465c2c1302a5c8d768a3cd23a )]:
- @gradio/client@0 .8.2
- @gradio/upload@0 .5.1
2023-11-21 05:45:52 +08:00
## 0.5.0
### Highlights
#### New `ImageEditor` component ([#6169](https://github.com/gradio-app/gradio/pull/6169) [`9caddc17b`](https://github.com/gradio-app/gradio/commit/9caddc17b1dea8da1af8ba724c6a5eab04ce0ed8))
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.
< video src = "https://user-images.githubusercontent.com/12937446/284027169-31188926-fd16-4a1c-8718-998e7aae4695.mp4" autoplay muted > < / video >
```py
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")
)
```
2023-11-23 07:43:10 +08:00
Thanks [@pngwn ](https://github.com/pngwn )!
2023-11-21 05:45:52 +08:00
2023-11-17 11:54:38 +08:00
## 0.4.2
### Fixes
2023-11-23 07:43:10 +08:00
- [#6441 ](https://github.com/gradio-app/gradio/pull/6441 ) [`2f805a7dd` ](https://github.com/gradio-app/gradio/commit/2f805a7dd3d2b64b098f659dadd5d01258290521 ) - 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 ](https://github.com/freddyaboulton )!
2023-11-17 11:54:38 +08:00
2023-11-14 11:19:34 +08:00
## 0.4.1
### Patch Changes
- Updated dependencies [[`324867f63` ](https://github.com/gradio-app/gradio/commit/324867f63c920113d89a565892aa596cf8b1e486 )]:
- @gradio/client@0 .8.1
- @gradio/upload@0 .4.1
2023-11-11 07:12:33 +08:00
## 0.4.0
### Features
2023-11-14 11:19:34 +08:00
- [#6356 ](https://github.com/gradio-app/gradio/pull/6356 ) [`854b482f5` ](https://github.com/gradio-app/gradio/commit/854b482f598e0dc47673846631643c079576da9c ) - Redesign file upload. Thanks [@hannahblair ](https://github.com/hannahblair )!
- [#6307 ](https://github.com/gradio-app/gradio/pull/6307 ) [`f1409f95e` ](https://github.com/gradio-app/gradio/commit/f1409f95ed39c5565bed6a601e41f94e30196a57 ) - Provide status updates on file uploads. Thanks [@freddyaboulton ](https://github.com/freddyaboulton )!
2023-11-11 07:12:33 +08:00
2023-11-08 07:50:13 +08:00
## 0.3.3
### Fixes
2023-11-14 11:19:34 +08:00
- [#6279 ](https://github.com/gradio-app/gradio/pull/6279 ) [`3cdeabc68` ](https://github.com/gradio-app/gradio/commit/3cdeabc6843000310e1a9e1d17190ecbf3bbc780 ) - Ensure source selection does not get hidden in overflow. Thanks [@hannahblair ](https://github.com/hannahblair )!
2023-11-08 07:50:13 +08:00
2023-11-04 03:16:42 +08:00
## 0.3.2
### Fixes
2023-11-14 11:19:34 +08:00
- [#6234 ](https://github.com/gradio-app/gradio/pull/6234 ) [`aaa55ce85` ](https://github.com/gradio-app/gradio/commit/aaa55ce85e12f95aba9299445e9c5e59824da18e ) - Video/Audio fixes. Thanks [@freddyaboulton ](https://github.com/freddyaboulton )!
2023-11-04 03:16:42 +08:00
2023-10-31 23:25:11 +08:00
## 0.3.1
### Patch Changes
- Updated dependencies [[`2ba14b284` ](https://github.com/gradio-app/gradio/commit/2ba14b284f908aa13859f4337167a157075a68eb )]:
- @gradio/client@0 .7.1
- @gradio/upload@0 .3.1
2023-10-31 21:20:18 +08:00
## 0.3.0
### Features
2023-10-31 23:25:11 +08:00
- [#5498 ](https://github.com/gradio-app/gradio/pull/5498 ) [`287fe6782` ](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7 ) - fix circular dependency with client + upload. Thanks [@pngwn ](https://github.com/pngwn )!
- [#5498 ](https://github.com/gradio-app/gradio/pull/5498 ) [`287fe6782` ](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7 ) - Image v4. Thanks [@pngwn ](https://github.com/pngwn )!
- [#5498 ](https://github.com/gradio-app/gradio/pull/5498 ) [`287fe6782` ](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7 ) - Custom components. Thanks [@pngwn ](https://github.com/pngwn )!
2023-10-31 21:20:18 +08:00
2023-10-31 12:46:02 +08:00
## 0.3.0-beta.6
2023-10-18 14:38:35 +08:00
2023-10-31 12:46:02 +08:00
### Features
2023-10-31 23:25:11 +08:00
- [#6143 ](https://github.com/gradio-app/gradio/pull/6143 ) [`e4f7b4b40` ](https://github.com/gradio-app/gradio/commit/e4f7b4b409323b01aa01b39e15ce6139e29aa073 ) - fix circular dependency with client + upload. Thanks [@pngwn ](https://github.com/pngwn )!
- [#6136 ](https://github.com/gradio-app/gradio/pull/6136 ) [`667802a6c` ](https://github.com/gradio-app/gradio/commit/667802a6cdbfb2ce454a3be5a78e0990b194548a ) - JS Component Documentation. Thanks [@freddyaboulton ](https://github.com/freddyaboulton )!
- [#6094 ](https://github.com/gradio-app/gradio/pull/6094 ) [`c476bd5a5` ](https://github.com/gradio-app/gradio/commit/c476bd5a5b70836163b9c69bf4bfe068b17fbe13 ) - Image v4. Thanks [@pngwn ](https://github.com/pngwn )!
2023-10-31 12:46:02 +08:00
## 0.3.0-beta.5
### Features
2023-10-31 23:25:11 +08:00
- [#6044 ](https://github.com/gradio-app/gradio/pull/6044 ) [`9053c95a1` ](https://github.com/gradio-app/gradio/commit/9053c95a10de12aef572018ee37c71106d2da675 ) - Simplify File Component. Thanks [@freddyaboulton ](https://github.com/freddyaboulton )!
2023-10-31 12:46:02 +08:00
### Fixes
2023-10-31 23:25:11 +08:00
- [#6046 ](https://github.com/gradio-app/gradio/pull/6046 ) [`dbb7de5e0` ](https://github.com/gradio-app/gradio/commit/dbb7de5e02c53fee05889d696d764d212cb96c74 ) - fix tests. Thanks [@pngwn ](https://github.com/pngwn )!
2023-10-31 12:46:02 +08:00
## 0.3.0-beta.4
### Features
2023-10-18 14:38:35 +08:00
2023-10-31 23:25:11 +08:00
- [#5938 ](https://github.com/gradio-app/gradio/pull/5938 ) [`13ed8a485` ](https://github.com/gradio-app/gradio/commit/13ed8a485d5e31d7d75af87fe8654b661edcca93 ) - V4: Use beta release versions for '@gradio' packages. Thanks [@freddyaboulton ](https://github.com/freddyaboulton )!
2023-10-18 14:38:35 +08:00
2023-10-17 04:30:41 +08:00
## 0.3.3
### Patch Changes
- Updated dependencies [[`e70805d54` ](https://github.com/gradio-app/gradio/commit/e70805d54cc792452545f5d8eccc1aa0212a4695 )]:
- @gradio/atoms@0 .2.0
2023-10-06 05:10:45 +08:00
## 0.3.2
### Patch Changes
- Updated dependencies []:
- @gradio/atoms@0 .1.4
2023-10-03 11:55:55 +08:00
## 0.3.1
### Patch Changes
- Updated dependencies [[`8f0fed857` ](https://github.com/gradio-app/gradio/commit/8f0fed857d156830626eb48b469d54d211a582d2 )]:
- @gradio/icons@0 .2.0
- @gradio/atoms@0 .1.3
2023-09-27 05:50:39 +08:00
## 0.3.0
### Features
2023-10-03 11:55:55 +08:00
- [#5554 ](https://github.com/gradio-app/gradio/pull/5554 ) [`75ddeb390` ](https://github.com/gradio-app/gradio/commit/75ddeb390d665d4484667390a97442081b49a423 ) - Accessibility Improvements. Thanks [@hannahblair ](https://github.com/hannahblair )!
2023-09-27 05:50:39 +08:00
2023-09-08 04:26:14 +08:00
## 0.2.1
### Patch Changes
- Updated dependencies []:
- @gradio/atoms@0 .1.2
2023-09-02 08:27:32 +08:00
## 0.2.0
### Features
2023-09-08 04:26:14 +08:00
- [#5373 ](https://github.com/gradio-app/gradio/pull/5373 ) [`79d8f9d8` ](https://github.com/gradio-app/gradio/commit/79d8f9d891901683c5a1b7486efb44eab2478c96 ) - Adds `height` and `zoom_speed` parameters to `Model3D` component, as well as a button to reset the camera position. Thanks [@abidlabs ](https://github.com/abidlabs )!
2023-09-02 08:27:32 +08:00
2023-08-24 06:41:08 +08:00
## 0.1.0
### Highlights
#### Improve startup performance and markdown support ([#5279](https://github.com/gradio-app/gradio/pull/5279) [`fe057300`](https://github.com/gradio-app/gradio/commit/fe057300f0672c62dab9d9b4501054ac5d45a4ec))
##### 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.
2023-09-08 04:26:14 +08:00
Thanks [@pngwn ](https://github.com/pngwn )!
2023-08-24 06:41:08 +08:00
### Features
2023-09-08 04:26:14 +08:00
- [#5216 ](https://github.com/gradio-app/gradio/pull/5216 ) [`4b58ea6d` ](https://github.com/gradio-app/gradio/commit/4b58ea6d98e7a43b3f30d8a4cb6f379bc2eca6a8 ) - Update i18n tokens and locale files. Thanks [@hannahblair ](https://github.com/hannahblair )!
2023-08-24 06:41:08 +08:00
### Fixes
2023-09-08 04:26:14 +08:00
- [#5285 ](https://github.com/gradio-app/gradio/pull/5285 ) [`cdfd4217` ](https://github.com/gradio-app/gradio/commit/cdfd42174a9c777eaee9c1209bf8e90d8c7791f2 ) - Tweaks to `icon` parameter in `gr.Button()` . Thanks [@abidlabs ](https://github.com/abidlabs )!
2023-08-24 06:41:08 +08:00
2023-08-11 04:59:00 +08:00
## 0.0.3
### Fixes
- [#5077 ](https://github.com/gradio-app/gradio/pull/5077 ) [`667875b2` ](https://github.com/gradio-app/gradio/commit/667875b2441753e74d25bd9d3c8adedd8ede11cd ) - Live audio streaming output
highlight:
#### Now supports loading streamed outputs
Allows users to use generators to stream audio out, yielding consecutive chunks of audio. Requires `streaming=True` to be set on the output audio.
```python
import gradio as gr
from pydub import AudioSegment
def stream_audio(audio_file):
audio = AudioSegment.from_mp3(audio_file)
i = 0
chunk_size = 3000
2023-09-08 04:26:14 +08:00
2023-08-11 04:59:00 +08:00
while chunk_size*i < len ( audio ) :
chunk = audio[chunk_size*i:chunk_size*(i+1)]
i += 1
if chunk:
file = f"/tmp/{i}.mp3"
2023-09-08 04:26:14 +08:00
chunk.export(file, format="mp3")
2023-08-11 04:59:00 +08:00
yield file
2023-09-08 04:26:14 +08:00
2023-08-11 04:59:00 +08:00
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()
```
2023-09-08 04:26:14 +08:00
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 ](https://github.com/aliabid94 )!
2023-08-11 04:59:00 +08:00
2023-07-27 05:10:24 +08:00
## 0.0.2
### Patch Changes
- Updated dependencies []:
2024-03-06 08:54:36 +08:00
- @gradio/atoms@0 .0.2