Commit Graph

819 Commits

Author SHA1 Message Date
pngwn
fbf4edde7c
Client fixes (#8272)
* fix param name

* fix hidden state variable

* pass jwt to heartbeat event

* notebooks

* format

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-13 15:35:07 +01:00
aliabid94
5436031f92
Render decorator 2 (#8110)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changeas

* changes

* add changeset

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* cganges

* changes

* changes

* changes

* changes

* add changeset

* changes

* chagnes

* changes

* changes

* changes

* changes

* remove console log

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-06 08:36:07 -07:00
Yuichiro Tachibana (Tsuchiya)
937c858371
Use orjson to serialize dict including np.array (#8041)
* Use orjson to serialize dict including np.array

* add changeset

* Update json_component demo and add an E2E test using it

* Rename demo/json_component -> demo/json_component_blocks

* Add json_component_interface demo and an E2E test using it

* Fix to await assertion promises

* Revert renaming of json_component demo

* add changeset

* Rename js/app/test/json_component_blocks.spec.ts -> js/app/test/json_component.spec.ts

* Revert changes in routes.py and add orjson to json_component.py

* Update gr.Checkbox.postprocess to ensure a bool value is returned

* add changeset

* Remove the if-block in gr.Checkbox.postprocess handling NumPy arrays as they are not reasonable values to be interpreted as checkbox's value

* Update gr.JSON's docstring

* Add test/components/test_json_component.py

* Remove JSON component E2E tests

* Update gr.JSON's docstring

* docstring

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-25 16:13:01 +09:00
Freddy Boulton
2afca65419
Add max_file_size parameter to launch() that limits the size of files that can be uploaded in the Gradio app (#7909)
* File size limits

* Implementation

* add changeset

* Fix tests

* python client support

* lint

* fix test

* lint

* add changeset

* Set at the blocks level

* add changeset

* type check

* format

* lint

* lint

* Delete files as soon as they're encountered

* fix tests

* type hint 🙄

* Fix tests

* Fix below limit test

* add changeset

* Fix tests

* Add client file

* revert loop code

* Add to guides

* Pass in via gradio component

* add changeset

* Update loading status

* Make errors closeable

* add changeset

* Add code

* Lint

* Changelog highlight

* Fix i18n in storybook

* Address comments

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-19 15:38:53 -04:00
pngwn
074ce3805a
ensure the ImageEditor works correctly with layers and change events (#8059)
* stuff

* fix layrs

* add changeset

* lint

* ensure a default image can be passed when sources list is empty

* fix loading status

* add layers option to disable layer ui

* types

* fix tests

* cleanup

* cleanup

* notebooks

* fix composite

* fix

* fix trash icon

* add changeset

* fix layer bg

* fix error display

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-18 15:55:00 +00:00
pngwn
92139f3d7d
refresh the ImageEditor UI (#8042)
* changes

* icons

* asd

* add changeset

* ui

* fix empty text position

* fix button toggle

* cleanup

* add changeset

* lint

* fix test

* fix again

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-17 16:45:35 -04:00
Yuichiro Tachibana (Tsuchiya)
522daf787a
Patch async_save_url_to_cache for Lite (#8026)
* Update `async_save_url_to_cache` to work on Wasm

* Refactoring `save_url_to_cache`

* add changeset

* Fix

* Use pyodide.http as a custom transport of httpx

* Use urllib3 as a custom transport of httpx to make sync http requests

* Add an E2E test case to detect the bugs on remote resource caching

* add changeset

* Add image_remote_url E2E test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-17 03:54:34 +09:00
Dawood Khan
55ef4a52c3
Fixes Chatbot Image Sizing (#8025)
* fix

* add changeset

* fix

* notebook fix

* clean

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-16 16:38:20 +02:00
pngwn
6fafce0670
ensure maps are correctly shallow cloned when updating state (#8028)
* ensure maps are correctly shallow cloned when updating state

* cleanup

* add changeset

* fix test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-15 17:26:15 -04:00
pngwn
dbb7373dde
ensure ImageEditor events work as expected (#7845)
* changes

* changes

* more fix

* more fix

* add changeset

* fix initial crop

* fix format

* fix format

* fix formats

* faster?

* race condition

* fixes + test

* fix type?

* notebooks

* fix type

* change demo

* add changeset

* fix type

* fix type

* fix type again

* fix type again again

* lint

* lint again

* fix test

* tests

* fix

* tests

* address comments

* fix notebooks

* fix tests

* fix stories

* fix webcam ui

* cleanup

* add changeset

* fix input event

* add format param + fix input event

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-15 20:16:07 +00:00
Freddy Boulton
c1df2f818c
Fix example loading for custom components (#7981)
* format

* add changeset

* add changeset

* Update component

* Add tests

* Add code

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-10 17:52:41 -04:00
aliabid94
7c9a964ac6
Fix programmatic tab selection (#7916)
* changes

* changes

* add changeset

* changes

* add changeset

* changes

* add changeset

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-08 11:34:25 -07:00
pngwn
1eb4c20120
ensure kwargs are always in sync across the whole application (#7963)
* ensure kwargs are always in sync across the whole application

* add changeset

* fix test

* update accordion test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-08 18:12:14 +01:00
aliabid94
9666854790
Fixes streaming event race condition (#7926)
* changes

* add changeset

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-04 12:39:44 -07:00
Freddy Boulton
efd9524508
Fix gr.CheckboxGroup change event (#7915) 2024-04-03 07:19:58 -07:00
Freddy Boulton
6a4bf7abe2
Delete user state when they close the tab. Add an unload event for the demo and a delete_callback on gr.State to let developers control how resources are cleaned up (#7829)
* Delete state

* add changeset

* Delete state

* WIP

* Add load event

* Working ttl

* unload e2e test

* Clean up

* add changeset

* Fix notebook

* add changeset

* Connect to heartbeat in python client

* 15 second heartbeat

* Demo for unload

* Add notebook

* add changeset

* Fix docs

* revert demo changes

* Add docstrings

* lint 🙄

* Edit

* handle shutdown issue

* state comments

* client test

* Fix:

* Fix e2e test

* 3.11 incompatibility

* delete after one hour

* lint + highlight

* Update .changeset/better-tires-shave.md

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

* Update .changeset/better-tires-shave.md

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>
2024-04-01 18:31:56 -04:00
aliabid94
5e66e01abc
Fix audio streaming out (#7881)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-01 02:25:16 -07:00
aliabid94
7bbc3b62bf
JS functions break entire app if there's no input, fixed (#7865)
* changes

* add changeset

* add changeset

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-28 14:54:46 -07:00
Freddy Boulton
ee804b2d56
Stop running iterators when js client disconnects (#7835)
* Add code

* add changeset

* move

* add changeset

* Add code

* Format notebook

* Address comments

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 17:41:40 +00:00
Ali Abdalla
c62a57e7f8
Convert Docs Demos to Lite (#7661)
* edit demos

* edit demos

* remove and replace demos

* convert docs demos to lite

* add changeset

* working

* styling

* notebook

* notebook

* formatting

* /docs embedding from spaces

* shared worker mode

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 17:32:23 -07:00
Abubakar Abid
dd3e363261
Fail CI if lint or typecheck fails (#7770)
* fail

* test

* revert

* run shebang

* fix

* fixes

* add changeset

* changes

* bash

* not required

* file

* textbox

* add changeset

* changes to demo

* notebook

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-21 11:34:56 -04:00
Dawood Khan
15da39fca0
Multimodal Textbox (Chat Input Component) (#7420)
* first pass

* multimodal textbox

* add changeset

* remove file

* more changes

* changes

* add changeset

* revert demo

* doc strings fix

* update demo

* file icons

* more updates

* format

* add story

* remove doc line

* type fixes

* chat interface

* new demo

* image upload fix

* ui changes

* addressing PR comments

* format

* type check

* more pr fixes

* format

* format

* test fixes

* test fixes

* Streaming fixes + other stuff

* optional keys to dict value

* final fixes

* notebook

* format

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* merge

* backend fixes

* story fix

* ui test fix

* format

* story

* format

* demo fix

* streaming test fix

* stories fix

* stories fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-19 13:16:05 -07:00
pngwn
5d1e8dae5a
batch UI updates on a per frame basis (#7564)
* changes

* process fe fn tests

* cleanup

* cleanup

* create_target_meta tests and abstraction

* add interactivity detection and tests

* more functions more tests

* add tests for component loader, fix errors

* fix everything

* add changeset

* add changeset

* ci

* cleanup

* cleanup

* test

* fix again

* tweaks

* cleanup

* add changeset

* fix loading_status

* cleanup

* ensure updates have been flushed before making API requests

* add changeset

* df fix

* fixes

* fix dataframe updates

* fix dataframe updates

* remove $open var

* add changeset

* fix tests

* extend timeout for lite

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2024-03-13 13:46:40 +00:00
Abubakar Abid
355ed666d9
Fix the root_url logic for streaming files (#7614)
* fix

* add changeset

* ignore

* add changeset

* changes

* changes

* linting

* demo

* changes

* blocks

* add changeset

* diff

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-05 15:21:45 -08:00
Dawood Khan
26356a623c
Fixes: Invalid file_type breaks drag and drop (#7559)
* file type fix

* add changeset

* pdf test

* format

* test fixes

* file test fix

* file path fix

* new test

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2024-03-05 16:52:22 -05:00
Abubakar Abid
bd2c695328
Adds a gr.DownloadButton component (#7518)
* py

* path

* barebones js

* add changeset

* add changeset

* downloadbutton

* add changeset

* changes

* clog

* commit

* revert'

* fix

* js

* add changeset

* cleanup

* download

* notebooks

* stories

* change

* fix

* format

* download

* Fix updating `icon` parameter (bug resulting from https://github.com/gradio-app/gradio/pull/7528) (#7554)

* fetch 2

* fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-28 12:07:36 -08:00
aliabid94
ba3ec1300e
Tab select fix (#7470)
* changes

* add changeset

* changes

* changes

* changes

* Update js/tabs/shared/Tabs.svelte

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

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
2024-02-21 17:27:58 -06:00
aliabid94
f52cab634b
Dispatch change event for file explorer (#7441)
* changes

* add changeset

* changes

* changes

* fix test reqs in functional tests

* fix notebooks

* fix notebooks

* fix test flake

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-02-16 12:03:10 -06:00
pngwn
805a5136a1
fix test reqs in functional tests (#7454) 2024-02-16 17:27:07 +00:00
Dylan Ebert
3e886d8f0a
Model3D Gaussian Splatting (#7406)
* add gsplat dependency

add gsplat implementation

run formatting

move example .splat and .ply to url

add changeset

dispose of renderer on unmount

notebook

* dynamically load canvas components
2024-02-14 19:10:52 +00:00
pngwn
c2dfc592a4
remove static while pending behaviour (#7410)
* remove static while pending behaviour

* add changeset

* fix notebooks

* add changeset

* cleanup unused code + fix test

* fix notebooks

* oops

* re-add check

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-14 16:15:16 +00:00
Abubakar Abid
065c5b163c
Add .key_up event listener to gr.Dropdown() (#7404)
* dropdown choice bug

* add changeset

* add changeset

* changes

* add changeset

* format

* key down:

* change

* change

* format

* add KeyDownData

* changes

* add demo

* notebook

* add changeset

* key up

* notebook

* changes

* Delete .changeset/shaggy-hairs-peel.md

* Delete .changeset/tasty-spies-spend.md

* revert changeset deletion

* change

* fix unit test

* type disable

* fix

* cset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-13 17:14:07 -08:00
aliabid94
65437ce832
Improve File Explorer performance (#7337)
* changes

* add changeset

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* Update gradio/components/file_explorer.py

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

* Update gradio/components/file_explorer.py

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

* Update demo/file_explorer_component_events/run.py

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

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-02-13 16:51:47 -06:00
Abubakar Abid
547517b74e
Small PR to move generate_notebooks.py to scripts folder (#7400)
* move generate_notebooks.py to scripts folder

* generate notebooks

* final? fix
2024-02-13 09:05:19 -08:00
Hannah
46b45683e1
Allow applying @media, @keyframes and @import in custom CSS (#7395)
* allow @media and @keyframes in custom CSS

* add changeset

* demo tweak

* formatting

* fix

* tweak

* add .dark test

* formatting

* add font-face test

* support @import statements

* add changeset

* tweak

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-13 00:39:30 +01:00
Ari Roffe
10951105b8
Upgrade from numpy's Legacy Random Generator to Random Generator (#7397)
* Update run.py

* replace all np.random.random with new generator code

* notebooks

---------

Co-authored-by: aroffe99 <ari.roffe@morningstar.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-02-12 10:20:46 -08:00
Ari Roffe
0dccf825c4
Add step parameter to slider (#7399)
* Add step parameter to slider

* fix demos

* changes

* tweaks to demo

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-02-12 10:06:46 -08:00
Freddy Boulton
a4a990ca05
Custom component 2e2 test (#7394)
* e2e test

* Add requirements
2024-02-12 10:06:22 -08:00
Hannah
4dc9ffbf70
Store gr.Accordion's open value (#7375)
* store open as writeable val

* add changeset

* add e2e test

* formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-10 00:09:59 +01:00
pngwn
a7fa47a175
ensure Dataframes in background tabs are visible when the tab is selected (#7354)
* add mutation observer to track visibility changes of tabs

* add changeset

* add changeset

* update console.log statements in Svelte component for debugging purposes

* remove unused table_width variable and update console logs in virtual table component

* move visibility check to table

* try dom rect bindings instead

* update binding of viewport_box to correctly calculate viewport height

* remove console.log statements and unused code

* add changeset

* add changeset

* remove unnecessary assignment of t_width in component

* update svelte-check to make ci pass

* update dependencies for happy-dom and vitest
merged from upstream

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-09 18:23:05 +00:00
Abubakar Abid
8bb0ce2e40
Hotfix for: stt_or_tts demo (#7332)
* fix

* add changeset

* add changeset

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-06 22:34:02 +00:00
Dawood Khan
c3e61e4f70
Few File component drag and drop (#7141)
* file comp fixes

* add changeset

* test fixes

* undo pr fixes

* add changeset

* file type fix

* format

* final fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-31 16:23:11 -05:00
Abubakar Abid
3c8c4ac2db
Document the gr.ParamViewer component, and fix component preprocessing/postprocessing docstrings (#7116)
* add paramviewer to docs

* add changeset

* type fixing

* round to

* format

* revert to make test pass

* remove msg

* add changeset

* annotated image

* annotated image
push

* audio

* changes

* changes

* audio

* audio

* changes

* remove borders from code

* working

* fixes

* add changeset

* formatting

* build fix

* changes

* ls

* more components

* format

* some more

* more

* component

* plots

* buttons

* simple backend

* number

* more

* more

* simple templates

* format

* fixes

* backend

* fix tests

* fix test

* fixes

* formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-01-31 09:36:21 -08:00
Hannah
ded5256c4a
Fix audio recording events not dispatching (#7158)
* fix audio events and add events test

* add changeset

* add changes to audio demo

* Fix e2e tests

* regenerate notebook

* formatting

* test timeout for e2e

* formatting

* remove value param from stop_recording

* formatting

* fix test

* formatting

* tweak

* test new playwright config

* skip test

* formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-01-26 18:13:27 +01:00
AbhishekKr
9949cdc850
Fix fake_diffusion demo by slider to only have int so range() doesn't fail (#7167)
Signed-off-by: AbhishekKr <abhikumar163@gmail.com>
2024-01-26 11:52:10 -05:00
Freddy Boulton
c60ad4d34a
Use Gallery as input component (#7148)
* 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 (#7139)
* 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
Abubakar Abid
7d53aa13a3
Miscellaneous doc fixes (#7131)
* fixes

* few doc fixes

* add changeset

* add changeset

* state in demo

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-24 11:52:23 -08:00
Hannah
c35fac049a
Ensure device selection works in Audio when streaming (#7082)
* Fix microphone device access denied issue

* add changeset

* add microphone test

* create shared DeviceSelect component

* add changeset

* add e2e test

* regen notebooks

* formatting

* Fix e2e test

* formatting

* adjust controls box

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-23 10:49:29 +01:00
Hannah
80f8fbf0e8
Add logic to handle non-interactive or hidden tabs (#7107)
* Refactor change_tab function to handle non-interactive or hidden tabs

* add changeset

* Refactor flashcards app UI and modify test

* Fix formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-01-22 23:31:59 -08:00