Commit Graph

6518 Commits

Author SHA1 Message Date
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
Sc077y
e10ec6a612
Fix multimode interface double box on file upload (#8014)
* fix(chat_interface.py): fix 'submit_btn' not being set to 'None' when an instance of 'gr.MultimodalTextbox' is passed to 'textbox' argument of 'ChatInterface'

* fix typo

* add changeset

* fix(chat_interface.py): fix 'container' glitch for multimodal interface

* fix(chat_interface.py): fix bug where empty string is added to history when only a file or more was provided

* fix prior commit

* add changeset

* fix lines interchanged

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-04-12 19:37:16 -04:00
Michael
299c87c477
Document that show_copy_button in gr.Textbox is not visible when show_label=False (#8012)
* Document that show_copy_button in gr.Textbox is not visible when show_label=False
Remove dict_to_dataclass since its not used

* add changeset

* tweak wording

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-12 18:17:19 +00:00
aliabid94
06bdf0eddf
Restore chatbot formatting (#7998)
* changes

* add changeset

* 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: Abubakar Abid <abubakar@huggingface.co>
2024-04-11 22:40:08 +00:00
Freddy Boulton
8903415e49
Add show_progress prop to Upload Component to bring back upload progress animation (#8002)
* Add show_progress prop

* add changeset

* Add code

* skip for now

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-11 15:30:30 -07:00
cocktailpeanut
05f935c8d8
GRADIO_SHARE Environment Variable (#7986)
* GRADIO_SHARE Environment Variable

An environment variable to force `share=True` when launching gradio, regardless of what was passed in as argument.

Useful for taking any Gradio-powered app and making them run with the gradio.live link WITHOUT having to update the code.

* make it work for both share=True and share=False

* correct parsing

- `"GRADIO_SHARE": "0"` => `False`
- `"GRADIO_SHARE": "1"` => `True`

* comment

* Apply GRADIO_SHARE only if it's not specified in code.

* one line

* remove line

* add changeset

* included in docstring

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-11 10:29:22 -04: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
Yuichiro Tachibana (Tsuchiya)
79e0aa81c9
Fix heartbeat in the js client to be Lite compatible (#7974)
* Fix heartbeat in the js client to be Lite compatible

* add changeset

* add changeset

* Stop assigning the EventSource instance to a variable at heartbeat

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-10 23:13:12 +09:00
Lucain
5f0248e797
When authenticating with HF OAuth, stay in same tab (#7887)
* OAuth: stay in same tab

* add changeset

* add changeset

* typo

* scroll

* add changeset

* lint

* test

* test with timeout

* log

* new test

* fix origin in postMessage

* with timeout

* shoud be fine

* lint

* lint

* remove logs

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-10 14:15:26 +01:00
Charles
d28dab8224
[ZeroGPU] postMessage zerogpu-headers (#7877)
* Backup

* postMessage origin

* postMessage "zerogpu-headers" -> fetch headers

* Fix api_factory headers

* Oops

* ruff format

* Prettier

* Fix from_config

* Works with direct URL (without auth headers)

* Check that we're on Spaces

* Honor formatting
2024-04-09 12:44:15 -07:00
pngwn
b561a27816
chore: update versions (#7914) 2024-04-08 20:07:24 +01:00
Scott Davidson
1a7851c512
Fix handling of single font name in theme (#7967)
* Fix handling of single font name in theme

Previous check failed because `str` is an instance of Iterable so was never correctly wrapped in `[...]`. Instead, providing a single font such as "Arial" would result in a font list of "A, r, i, a, l" in the bundled CSS.

* Handle single fonts.Font instance correctly

* add changeset

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abid <aliabid94@gmail.com>
2024-04-08 11:52:56 -07: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
Hannah
057d171c71
Correctly handle device selection in Image and ImageEditor (#7754)
* move on:change to <select>

* add changeset

* move device logic to separate file + fix safari incompatability

* improve selected logic

* add stream_utils unit tests

* refactor default device logic

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-08 19:20:47 +01:00
Ihtsham Shafiq
328325a7ad
style changes for gradio website docs navbar (#7945)
* style changes for navbar items and menu bar button

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2024-04-08 10:33:00 -07:00
renovate[bot]
f3f60dafb5
Update actionsdesk/lfs-warning action to v3.3 (#7937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-08 10:13:44 -07:00
renovate[bot]
aeb9129110
Update dependency @testing-library/dom to v10 (#7962)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-08 10:13:23 -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
Dawood Khan
be46ab1213
ensure entire dropdown is clickable (#7918)
* dropdown click fix

* add changeset

* add changeset

* fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-08 13:06:14 -04:00
WH-Yoshi
bad383645e
Adding hint list[list] for example parameter (#7966)
* Adding hint list[list] for example parameter

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-08 16:44:32 +00:00
Freddy Boulton
eae97c29ce
Fix task bug in python 3.9 (#7961) 2024-04-08 07:59:53 -07:00
Freddy Boulton
b78129d90f
Use asyncio.Event to stop stream in heartbeat route (#7932) 2024-04-05 11:57:49 -07:00