Commit Graph

6639 Commits

Author SHA1 Message Date
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
pngwn
e089e4cb4a
update dependencies (#8122)
* updates

* add changeset

* changeset

* changeset

* types

* fix types

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-24 23:55:14 +01:00
Freddy Boulton
38a5482df4
Be able to link to a custom component in the gallery directly (#8119)
* take a stab

* fix code

* add changeset

* revert lock

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-24 17:55:48 -04:00
Freddy Boulton
68640358fe
Add session hash to gr request (#8117)
* Add code

* add changeset

* Improve docs'

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-24 15:29:32 -04:00
Abubakar Abid
487db7b5d5
Respect auth_dependency parameter in launch() (#8097)
* respect auth dependency provided in launch()

* add changeset

* format

* add changeset

* changes

* fix lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-23 14:26:19 -07:00
Abubakar Abid
cbf2d4ec51
fix typo from #8105 (#8107)
* js docs

* changes

* fix typo
2024-04-23 20:34:20 +00:00
Ali Abdalla
17e83c958e
Docs Reorg and Intro Page (#8061)
* docs intro page and guides

* python library docs and js client

* reorg

* changes

* add better hovering

* fix broken version routing

* add redirects and remove duplicate pages

* fix build issues

* fix issues

* formatting

* add changeset

* add changeset

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* Update js/_website/src/routes/[[version]]/docs/+page.svelte

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

* styling changes

* formatting

* fix build

* rounded corners on buttons

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-23 13:33:45 -07:00
Abubakar Abid
006fa3c6d0
improve the documentation for js parameter in Blocks, Interface, ChatInterface (#8105)
* js docs

* changes

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-23 13:16:54 -07:00
Abubakar Abid
cbdfbdfc97
upgrade ruff test dependency to ruff==0.4.1 (#8100)
* upgrade ruff==0.4.1

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-23 09:16:58 -07:00
Freddy Boulton
32cfa614d6
Remove auto-created files from gradio cc publish and other tweaks (#8040)
* Change flow

* add changeset

* Add readme

* Fix twine issue and artifacts

* add changeset

* Update gradio/cli/commands/components/publish.py

Co-authored-by: Lucain <lucainp@gmail.com>

* Upload gitignore file + HfAPI tweaks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Lucain <lucainp@gmail.com>
2024-04-23 10:57:20 -04:00
WalterSumbon
aaeb9dbbb0
Remove deprecated 'shape' parameter from tutorial (#8103)
* Remove deprecated 'shape' parameter

* Remove deprecated 'shape' parameter
2024-04-23 10:15:11 -04:00
Yuichiro Tachibana (Tsuchiya)
5bf61cb15b
Hide the scroll bar in WaveformControls when it's not necessary (#8065)
* Hide the scroll bar in WaveformControls when it's not necessary

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-23 13:27:39 +09:00
Yuichiro Tachibana (Tsuchiya)
d665f40970
Fix custom JS function caller to concat the outputs of a dep to the inputs as the arguments (#8051)
* Fix custom JS function caller to concat the outputs of a dep to the inputs as the arguments

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-23 13:26:34 +09:00
aliabid94
91a7a31cd1
Store configs per session in the backend (#8030)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changeas

* add changeset

* unrelated fix

* Update gradio/blocks.py

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

---------

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-04-22 11:20:05 -07:00
renovate[bot]
659d3c51ae
chore(deps): update dependency iframe-resizer to v4.3.11 (#8092)
* chore(deps): update dependency iframe-resizer to v4.3.11

* add changeset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-22 09:35:35 -07:00
Ikko Eltociear Ashimine
d12beba6bb
Update creating-a-realtime-dashboard-from-google-sheets.md (#8095)
minor fix
2024-04-22 09:35:26 -07:00
Lucain
ac30e07f92
[HF OAuth] Logout user if oauth token has expired (#8093)
* Logout user if oauth token has expired

* add changeset

* add changeset

* mark flaky test as flaky

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-22 08:18:04 -07:00
Abubakar Abid
b50a67defe
Fix GRADIO_CACHE_EXAMPLES environment variable to only take effect if fn and outputs parameters are provided (#8087)
* lazy cache fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-21 11:39:48 -07:00
Hannah
1c99570f3c
Adjust View Api container z-index (#8084)
* update z-index to layer-top

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-20 04:09:06 +02:00
pngwn
1128f81478
fix changesets (#8085) 2024-04-19 20:30:51 -04:00
pngwn
624f9b9477
make gradio dev tools a local dependency rather than bundling (#8066) 2024-04-19 18:41:40 -04:00
Yuichiro Tachibana (Tsuchiya)
568eeb26a9
Fix gr.Interface.from_pipeline() to allow audio uploads and to display classification labels correctly (#8080)
* Allow audio file inputs

* Stop comma-splitting label texts

* add changeset

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-20 06:55:38 +09:00
renovate[bot]
d1e3676e73
chore(deps): update dependency katex to v0.16.10 [security] (#8083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 21:48:40 +00:00
Hannah
450b8cc898
Refactor JS Client (#7646)
* initial setup

* fix hf token prefix

* warnings + error handling

* implement stream, predict and submit

* update blocks with new client

* add changeset

* temp comment

* add changeset

* add sse_v3 chages

* imrpove typing, reimplement websocket logic

* refactor zerogpu logic

* integrate fetch_implemenation

* wasm changes

* tweaks

* tscheck fixes

* type fixes

* test

* test import tweaks

* test

* package.json

* improve typing + config

* config tweak

* remove fetch-mock

* pnpm lock

* config

* remove module

* tweak

* tweak

* fix config

* test

* test

* lockfile

* fix types

* more config tweaks

* type fixes

* formatting

* fix typing

* formatting

* type fixes

* test

* lockfile

* revert comment

* package.json

* tweak

* formatting

* test

* revert ts removal

* remove comments + logic fixes

* type fix

* formatting

* test

* stream logic changes

* fix test

* revert comments

* fix streaming test

* stream tweak

* data typing

* fix wasm fetch

* client typing tweaks

* more fixes + typing improvements

* move functions

* event_source tweaks

* cleanup

* add hardware types and cleanup jwt

* improve api info typing

* add await client() backwards compatiblity

* rename create to connect and move duplicate logic

* Update `Client` usage examples (#8003)

* update client examples

* remove test data

* fix types

* remove types changes

* client -> Client.create

* Update client/js/README.md

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

* Update client/js/README.md

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

* update duplicate docs

* attempt to update cn docs

* format

---------

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

* type improvements and config error handling

* fix image editor issue

* Merge branch 'main' into refactor-client

* improve typing

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-19 23:36:13 +02:00
Yuichiro Tachibana (Tsuchiya)
0fb058ec23
Fix the Lite custom element parser so it doesn't add the .code option when the entrypoint file is already specified (#8067)
* Fix the Lite custom element parser so it doesn't add the .code option when the entrypoint file is already specified

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-20 06:26:42 +09:00
Yuichiro Tachibana (Tsuchiya)
176a8a4d71
Fix Label component's value change detection to avoid infinite loop dispatching the change event (#8054)
* Fix Label component's value change detection to avoid infinite loop dispatching the change event

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-20 05:43:10 +09:00
Yuichiro Tachibana (Tsuchiya)
367a20c525
Fix the visual test on the Label component (#8078)
* Set the chromatic parameters on Label's stories to test it in different viewports

* Make the mock text longer
2024-04-20 05:14:06 +09:00
3210448723
d7461aab51
Fix an encoding issue in gradio/components/code.py (#8077)
* Fix an enconding issue in gradio/components/code.py

Changes Made:
Modified the postprocess function in gradio/components/code.py to handle file encoding properly.
Added encoding="utf-8" parameter to the open function when reading code files. I hardcoded UTF-8 because I couldn't figure out how to specify the encoding, similar to the fix in gradio-app#8075. My issue is gradio-app#8076

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-19 16:05:55 -04: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
Amos You
26e1c87179
fix: break words in dropdown + multiselect (#8058)
* fix: break words in dropdown + multiselect

* fix: prevent shrinking of x button
2024-04-19 09:53:38 -07:00
Toru Suzuki
5d9db89aa6
Fix causing Hot Reload (#8070) (#8075)
* Fix bug causing Hot Reload failure in code containing non-English languages due to missing encoding specification (#8070)

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-19 12:44:18 -04:00
Yuichiro Tachibana (Tsuchiya)
72f4ca88ab
Fix gr.Label styling and a11y markup (#8063)
* Set `text-align: left` to the texts in the Label component

* Remove unnecessary if-block, which is inside another if-block with the same condition

* Fix the accessibility markup

* add changeset

* add changeset

* Add Label.stories.svelte

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-18 15:37:48 -07:00
Yuichiro Tachibana (Tsuchiya)
462d2e9a13
Fix .config/playwright-setup.js deleting unused envvar and duplicated import (#8043) 2024-04-18 18:10:52 -04:00
Laura Yie
eb8a8025ae
fix typos in README and CHANGELOG (#8068) 2024-04-18 18:10:08 -04:00
pngwn
ddc5d3866c
chore: update versions (#7992)
* chore: update versions

* changeset

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-18 18:09:10 +00:00
pngwn
79d5285f0e
fix (#8064) 2024-04-18 13:53:39 -04:00
renovate[bot]
cecd6e4c4a
Update dependency iframe-resizer to v4.3.10 (#8062)
* Update dependency iframe-resizer to v4.3.10

* add changeset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-18 10:18:29 -07: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
Ernie Chu
d6c289b346
round [x, y, w, h] before cropping to avoid unexpected interpolation on pixel values (#8046) 2024-04-17 21:34:01 +02:00
Jannis Schönleber
0424c759d8
Update typer to drop [all] as it is no longer needed (#8050)
* Update `typer` to drop `[all]` as it is no longer needed

Source: https://typer.tiangolo.com/release-notes/#0121

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-17 19:01:17 +00:00
alpertunga-bile
576731051f
Adding wrapping-layouts guide (#7953)
* guide is created

* LayoutBase class implementation is added

* Implementations are added

* some writing mistakes are fixed

* writing mistake check is done

* simple example is added

* some additions are made

* the example is tested with given code snippets

* conclusion part is added

* space example is added

* some parts are refactored

* introduction is updated

* wrapping-layouts.md file is put under the other tutorials

* fixed markdown issues

* Example is written again

* remove the unnecessary implementations

* render function desc of LayoutBase is changed

* guide is made much simpler

* the guide is ready for visual check

* most of the bullet point elements are removed

* linguistic errors are fixed & ready for view check
2024-04-16 17:08:00 -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
Yuichiro Tachibana (Tsuchiya)
c9ddd847d6
Update the Lite custom element parser (#7975)
* Update the Lite custom element parser to deal with the text inside `<gradio-lite>` when there is no `<gradio-code>` elements, which works with other custom elements like `<gradio-requirements>`

* add changeset

* Remove `.trim()`

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-16 07:19:02 +09:00
hrrbay
2a5cb97824
ensure ImageEditor always draws at the correct position (#7959)
* reset layers on dimension change

* add changeset

* resets only if layer has dimension missmatch

* fix formatting

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-04-15 21:47:09 +00: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
Lucain
a0c2848ab5
Fix internal server error in HF OAuth workflow (#8000)
* Fix internal server error in HF OAuth workflow

* add changeset

* finally working

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-14 17:08:50 -05:00
Yuichiro Tachibana (Tsuchiya)
f17d1a0a6f
Add an explicit dependency of urllib3~=2.0 and update processing_utils.save_url_to_cache to use urllib3 for Lite support (#8011)
* Add an explicit dependency of `urllib3` and update `processing_utils.save_url_to_cache` to use `urllib3` for Lite support

* add changeset

* Update requirements.txt

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

* add changeset

* update test requirements

* update test reqs

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-14 17:46:55 +00:00