2
0
mirror of https://github.com/gradio-app/gradio.git synced 2024-12-21 02:19:59 +08:00
Commit Graph

902 Commits

Author SHA1 Message Date
Hannah
e3217b4186
Amend audio waveform colour ()
* change waveform color option types

* tweak waveform color setting

* snake case tweak

* add changeset

* tweak BE test

* tweak component BE test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-01-29 19:03:38 +01:00
Abubakar Abid
ccdaec4500
Add a simpleimage template for custom components ()
* simpleimage template

* add changeset

* changes

* change

* changes

* update backend

* update frontend

* add changeset

* lint

* fix package

* add changeset

* remove warnings

* docstrings

* fix error

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-26 17:29:29 -08:00
Freddy Boulton
c60ad4d34a
Use Gallery as input component ()
* Gallery as input

* add changeset

* Add keep_captions parameter

* revert notebooks

* fix docstring typo

* use tuples

* remove keep_captions

* Update js/app/test/gallery_component_events.spec.ts

Co-authored-by: pngwn <hello@pngwn.io>

* more precise type hint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-01-25 18:51:59 -05:00
cswamy
6abad53677
Added polars dataframe support with demo ()
* first commit

* minor update

* working polars

* fixed. demo added.

* add changeset

* dynamic import of polars

* Fix import logic

* add changeset

* Fix lint

* Add code

* Fix code

* Add code

* remove screenshot'

* delete

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
2024-01-25 12:56:54 -05:00
Freddy Boulton
b9616528ab
Remove kwargs from template components ()
* Add test

* add changeset

* Fix type hints

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-01-24 20:35:51 -05:00
Hannah
bc2cdc1df9
Allow download button for interactive Audio and Video components ()
* allow download button for interactive audio and video components

* add changeset

* document show_download_button in video.py

* ensure show_download_button is by default true for output and false for input components

* fix component test

* tweak default val

* val tweak

* fix test and add story

* pass editable param where needed

* fix another test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com>
2024-01-23 11:33:59 +01:00
tsukumi
e8b2d8b2f8
Add sample rate config option to gr.Audio() ()
* Fix a bug that caused the sample rate of audio to be 8000 Hz after trimming and a bug that caused volume amplification and clipping each time trimming was performed

* Fix format

* add changeset

* add sample_rate param to waveform_options

* add changeset

* set WaveformOptions defaults

* formatting

* formatting

* add changeset

* audio

* changes

* add changeset

* tweak sample rate logic + docstring

* Tweak docstring

* formatting

* linting

* type tweak

* remove redundant None check

* tweak waveform lifecycle

* fix test

---------

Co-authored-by: tsukumi <tsukumijima@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-01-22 10:56:48 -08:00
pngwn
3a944ed9f1
add autodocs ()
* add autodocs

* remove unused code

* add changeset

* fix all of the things

* fix all of the things

* add changeset

* fix things

* tewak

* fix dep

* add ruff as dep with min version

* make output pretty + fix bugs

* tweaks

* fixes

* fix types maybe

* fix arg refs

* fix test

* fix md

* add error for version

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-18 20:47:01 +00:00
Freddy Boulton
9201f86450
Raise error in build step if custom component package is not installed ()
* Check installation

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-18 10:44:32 -05:00
Abubakar Abid
9cefd2e90a
Refactor examples so they accept data in the same format as is returned by function, rename .as_example() to .process_example() ()
* image-editor-examples

* add changeset

* add changeset

* delete changeset

* change to process_example()

* add changeset

* changes for all components until dataset.py

* rename

* fix checkboxgroup

* format

* changes

* add changeset

* changes

* add changeset

* radio

* add changeset

* changes

* add changeset

* changes

* examples

* remove print

* fix

* clean

* add changeset

* fix tests

* fix tests

* fix test

* fix

* add changeset

* fix video example

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-10 16:35:25 -08:00
Abubakar Abid
623bc1aeb1
Switch default order for sources for gr.Video so that upload is the default ()
* switch default video source

* add changeset

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-10 12:02:53 -08:00
Abubakar Abid
ccf317fc97
Add additional_inputs, additional_inputs_accordion parameters to gr.Interface ()
* guide

* new docs

* changes

* interface

* add changeset

* add changeset

* added basic test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-10 11:44:00 -08:00
Abubakar Abid
e671e5415f
Allow gr.ClearButton and gr.DuplicateButton to be made hidden (and otherwise updated) ()
* clear visible

* test

* other buttons

* add changeset

* move resource to block cache

* revert

* Revert "revert"

This reverts commit 9830f253ac.

* notebook

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-03 11:29:16 -08:00
Abubakar Abid
c00da89c3e
Fix returning copies of a component instance from a prediction function ()
* add test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-03 11:26:58 -08:00
Dr. Christoph Mittendorf
be76467933
fixed typo ()
fixed typo
2023-12-29 08:17:57 -08:00
aliabid94
24a5836880
Component Server fix ()
* changes

* add changeset

* Update gradio/routes.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* changes

* changes

---------

Co-authored-by: Ali Abid <ubuntu@ip-172-31-25-241.us-west-2.compute.internal>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
2023-12-27 14:16:56 -08:00
Josh Wilson
31c23166f0
fix issue 6873: File with file_count='directory' bug ()
* fix issue 6873: File with file_count='directory' bug

* add changeset

* fixes

---------

Co-authored-by: Joshua Wilson <uqjwil54@uq.edu.au>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-26 11:57:49 -08:00
Abubakar Abid
48d6534b40
Add show_api parameter to events, and fix gr.load(). Also makes some minor improvements to the "view API" page when running on Spaces ()
* show api

* chnages

* add changeset

* changes

* changes to interface

* set show_api=False

* changes

* development

* examples

* changes

* add changeset

* changes

* changes

* format

* add changeset

* add changeset

* changes

* revert

* fixes

* is vaild

* push

* fixes'

* fixing

* fixes

* format

* fixed

* demo

* test

* format

* add changeset

* fix tests

* fix

* format

* cleanup

* remove

* fixes

* add test

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-22 11:59:02 -08:00
cswamy
77c900311e
Fixes issue 5781: Enables specifying a caching directory for Examples ()
* issue 5781 first commit

* second commit

* unnecessary str removed

* backend formatted

* Update gradio/helpers.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Update guides/02_building-interfaces/03_more-on-examples.md

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* tests added

* add changeset

* format

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-18 17:07:38 -08:00
Hannah
50496f967f
Adjust rounding logic when precision is None in gr.Number() ()
* adjust precision handling
add test

* add changeset

* formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-18 23:42:19 +00:00
Abubakar Abid
1b9d4234d6
Prevent file traversals ()
* prevent file traversal

* fix

* add changeset

* unit test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-18 14:30:22 -08:00
Abubakar Abid
526fb6c446
Fix gr.load() so that it works with the SSE v1 protocol ()
* fix for gr.load()

* add changeset

* fix

* add test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-15 12:35:46 -08:00
Abubakar Abid
c352811f76
Adds docstrings for gr.WaveformOptions, gr.Brush, and gr.Eraser, fixes examples for ImageEditor, and allows individual images to be used as the initial value for ImageEditor ()
* tweaks

* add changeset

* adding image editor

* changes

* add changeset

* docs

* add changeset

* add changeset

* refactor

* format

* example

* add changeset

* image editor

* add changeset

* commit

* added test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-15 10:43:39 -08:00
Freddy Boulton
51e241addd
Fix flaky CI tests (again 😓 ) ()
* network idle

* Use **/upload

* Test flakes

* Fix pythont tests

* add changeset

* Use right wait

* upload

* trigger ci

* swap order

* networkidle

* lint'

* df

* 2 workers

* networkidle

* Fix cli test

* pause

* 3.8 fix

* 3.8

* no promise.all

* trigger ci

* Add code

* mark xfail

* trigger ci

* timeout

* Empty

* Flake

* test

* Flakes

* change test

* awaits

* cleanup

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-14 12:40:36 -08:00
Abubakar Abid
a807ede818
Fix backend tests on Windows ()
* hotfix

* testing

* test

* fix

* fix

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-14 11:23:30 -08:00
Freddy Boulton
34f943101b
Python client properly handles hearbeat and log messages. Also handles responses longer than 65k ()
* first commit

* newlines

* test

* Fix depends

* revert

* add changeset

* add changeset

* Lint

* queue full test

* Add code

* Update + fix

* add changeset

* Revert demo

* Typo in success

* Fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-13 17:47:06 -05:00
pngwn
1459119c6e
chore: update versions ()
* chore: update versions

* change

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ali Abid <ubuntu@ip-172-31-25-241.us-west-2.compute.internal>
2023-12-12 18:32:54 -08:00
Freddy Boulton
c9673cacd6
Fix directory-only glob for FileExplorer ()
* Fix glob

* add changeset

* Fix test

* lint

* sort

* Remove empty

* Select directory + test

* Workign fix

* WOrkign fix

* Directory click 😅

* add changeset

* Fix test

* Add dirs

* Select directory + test

* WOrkign fix

* Directory click 😅

* WIP

* add code

* Lint

* Use same color as file icon

* Fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-12 16:39:11 -08:00
aliabid94
d76bcaaaf0
Fix api event drops ()
* changes

* changes

* add changeset

* changes

* changes

* changes

* changs

* chagnes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes~git push

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* changes

* changes

* changes

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-25-241.us-west-2.compute.internal>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-12 15:24:46 -08:00
Yoann Poupart
28a7aa917f
Mount on a FastAPI app with lifespan manager ()
* initial context manager fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-12 16:40:03 -05:00
Hannah
3240d042e9
Add editable parameter to Audio ()
* add editable param to audio and add story

* add changeset

* fix test

* fix test again

* tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-11 18:42:21 +01:00
Yuichiro Tachibana (Tsuchiya)
9a5811df92
Fix the download button of the gr.Gallery() component to work ()
* Fix the download button of the `gr.Gallery()` component to work

* Refactoring js/gallery/shared/Gallery.svelte

* Fix `gr.Gallery()` to set `orig_name` for URLs

* Fix Gallery.postprocess()

* Fix `download()` to fallback to `window.open()` when CORS is not allowed

* Fix `gr.Gallery` to leave  as None so it will be replaced with a local cache path and restore the `<a>` tag-based download feature on the frontend

* Align a variable name to its type name

* Fix Gallery's tests

* Fix the frontend test for gallery

* Revert "Fix `gr.Gallery` to leave  as None so it will be replaced with a local cache path and restore the `<a>` tag-based download feature on the frontend"

This reverts commit d754980cc27ded760bfc26df4310f913c2c6944a.

* Revert "Fix Gallery's tests"

This reverts commit 4e2aa3fff1.

* Revert "Fix the frontend test for gallery"

This reverts commit 007caa23e7.

* Fix for linter

* Add a test about the download button

* Fix type defs on Gallery.postprocess

* Improve TestGallery

* add changeset

* Update gradio/components/gallery.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Update gradio/components/gallery.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Revert "Update gradio/components/gallery.py"

This reverts commit 4d6e127305.

* Revert "Update gradio/components/gallery.py"

This reverts commit f2bfad0744.

* Use `tuple` instead of `typing.Tuple`

* Revert "Use `tuple` instead of `typing.Tuple`"

This reverts commit 69ab93cad4.

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-09 17:58:19 +01:00
Abubakar Abid
24e048196e
Hotfix: update huggingface_hub dependency version ()
* update requirements of hfhub

* add changeset

* requirements

* add changeset

* fixed

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-07 15:07:23 -08:00
Freddy Boulton
fe40308894
Rotate Images to Upright Position in preprocess ()
* Code

* add changeset

* remove comment

* Add back try except

* Add code

* Use warning

* Use warning

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-07 13:16:48 -05:00
Abubakar Abid
cfd57005bc
Cause gr.ClearButton to reset the value of gr.State ()
* state

* note

* add changeset

* buttons

* clear button

* lint

* if

* clear'

* reset state

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-06 17:35:19 -08:00
D V
8a70e83db9
switch from black to ruff formatter ()
* migrate from black to ruff

* fix script and dependencies

* applying ruff

* add changeset

* add changeset

* address ruff feedback

* replace linter

* fixed typing

* fix typing

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-06 15:16:32 -08:00
cswamy
7cbf96e0bd
Issue 5245: consolidate usage of requests and httpx ()
* issue 5245 commit 1

* formatted

* add changeset

* fixes

* fixes

* make changes in client too

* remove requests from client

* add changeset

* add changeset

* Fixes to test_utils.py in client

* fixes in client utils.py and test_utils.py

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-05 14:18:09 -08:00
Abubakar Abid
299f5e238b
Update HF token used in CI tests ()
* fix tests

* format

* fixes

* add changeset

* fixes

* fix

* fix

* update

* update

* test client

* format

* hf token 2

* add changeset

* add env

* add envs

* tests

* env

* fixes

* test external

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-12-05 12:49:48 -08:00
Freddy Boulton
d92c819419
Add concurrency_limit to ChatInterface, add IDE support for concurrency_limit ()
* concurrency limit chat interface

* add changeset

* Update gradio/chat_interface.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-12-04 17:19:53 -05:00
v-chabaux
13ace035ed
Update file_explorer.py - Fixing error if nothing selected in file_count=single mode (return None rather) ()
* Update file_explorer.py

Fixing error if nothing selected in file_count=single mode (return None rather)

* add changeset

* added unit tests

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-30 08:33:10 +00:00
Abubakar Abid
d4e3a51890
Allows setting parameters of gr.ChatInterface's Accordion ()
* Chat Interface Accordion

* add changeset

* typing

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-21 10:58:53 -08:00
Yuichiro Tachibana (Tsuchiya)
1baed201b1
Fix SourceFileReloader to watch the module with a qualified name to avoid importing a module with the same name from a different path ()
* Fix SourceFileReloader to watch the module with a qualified name to avoid importing a module with the same name from a different path

* Fix the unit tests

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-20 13:54:26 -05:00
Abubakar Abid
a1e3c61f41
Allow setting a default_concurrency_limit other than 1 ()
* changes

* format

* add changeset

* add changeset

* fix

* format

* fix

* add test

* change

* update test

* moved to queue()

* typo

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-16 12:42:49 -08:00
Freddy Boulton
58e3ca8260
Custom Component CLI Improvements ()
* Finishing touches

* Disable metadata prompt in tests

* add changeset

* lint website

* Fix link:

* Fix redirects

* failsafe

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-16 13:23:50 -05:00
112292454
ac4ca59c92
Extract video filenames correctly from URLs ()
* Update video.py

cannot process url like "https:/example.com/avatar/xxxx.mp4?se=2023-11-16T06:51:23Z&sp=r" correctly, will get format like"mp4?se=2023-11-16T06:51:23Z&sp=r", and do unnecessary convert

* add changeset

* add changeset

* separate util function

* separated into util function

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-11-15 22:36:39 -08:00
aliabid94
324867f63c
Fix event target ()
* changes

* changes

* add changeset

* chagnes

* chaneg

* changes

* fix

* changes

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-13 15:14:55 -08:00
Yuichiro Tachibana (Tsuchiya)
8ef48f8524
Async functions and async generator functions with the every option to work ()
* Extend `get_continuous_fn()` to deal with async functions and async generator functions

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-13 16:12:49 -05:00
Yuichiro Tachibana (Tsuchiya)
d84209703b
Lite: SharedWorker mode ()
* Create the SharedWorker mode

* Fix the app_id management mechanism to be context-based so it works properly with run_file() and run_code()

* Adjust updateProgress() for the SharedWorker mode

* Make `get_continuous_fn()` Wasm-compatible in order for the created function not to occupy the thread with a loop with `time.sleep()` which is no-op in the Wasm env

* add changeset

* Add the `shared-worker` option to the custom-element API

* Apply formatter to js/app/src/lite/index.ts

* format

* Revert pnpm-lock.yml file version which is not needed to be changed in this PR

* Fix the unittest for `get_continuous_fn()`

* Fix the unit test because `anext()` is not available in Python 3.8, which is used in the CI env

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-11-13 17:32:00 +09:00
Freddy Boulton
2090aad731
Move wavesurfer dep to js/audio ()
* Move wavesurfer dep to js/audio

* Add code

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-12 12:18:11 -05:00
Abubakar Abid
de998b2812
Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache ()
* format

* add changeset

* add changeset

* add changeset

* whoops fix

* notebook

* tests

* refactor

* refactor

* format

* added test

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-11 23:13:27 -08:00