Commit Graph

6600 Commits

Author SHA1 Message Date
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
Alfiya
f2a1a859ae
Clarify the streaming response documentation (#7924)
* Clarify the streaming response documentation

You cannot simply yield one new token at a time, you have to yield the new full response.

* Clarify streaming chatbot instructions

* Clarify streaming chatbots
2024-04-05 11:54:39 -04:00
Abubakar Abid
8250a1a0df
Handle the case of multiple headers when constructing root url (#7938)
* handle the case of multiple headers

* lint

* add changeset

* Update gradio/route_utils.py

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-05 02:35:12 +00:00
Abubakar Abid
919afffcee
Adds a Guide on deploying Gradio apps with Docker (#7935)
* finish guide

* more informative exception

* add changeset

* add dockerfile to prism languages

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-04-04 19:23:23 -07:00
aliabid94
b165193902
Restore Markdown formatting for Chatbots, MarkdownCode (#7936)
* changes

* add changeset

* changes

* add changeset

* changes

* changes

* changes

* changes

* add changeset

* chages

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-04 15:04:46 -07: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
Ali Abdalla
b43055b297
Lite playground design changes (#7811)
* prevent new line on cmd+enter shortcut

* add copy button

* add download button

* better font sizing and align editor buttons

* button colors and header positioning

* add layout attribute

* height issue

* border fix

* overflow

* add changeset

* tests

* tweaks to index

* fix formatting in index.html

* fix event listener

* better alignment on header

* fix padding on code editor buttonsm

* add dark mode

* formatting

* fix heights issues

* add to guide

* shared worker and small fix

* Update guides/08_gradio-clients-and-lite/gradio-lite.md about SharedWorker mode (#7923)

* layout edit in guide

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
2024-04-04 04:38:12 -07:00
Freddy Boulton
a4782f7a09
Allow displaying gr.Code examples by their filename if value is a tuple (#7912)
* Add code

* add changeset

* add changeset

* Only display filename

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-04 00:38:55 +00:00
Bocheng Zou
867ff16cd4
Trigger the "clear" event of Image Editor (#7817) 2024-04-03 23:45:59 +01:00
Abubakar Abid
2bae1cfbd4
Adds an "API Recorder" to the view API page, some internal methods have been made async (#7850)
* changes

* code recorder

* api docs

* add changeset

* changes

* change

* add changeset

* add changeset

* changes

* fixes

* format

* changes

* fix

* add changeset

* rename

* api recorder

* docs

* changes for pr

* fix

* async-ify

* add changeset

* fix typing

* fixes

* fix test/test_blocks

* fix more tests

* fix test

* add changeset

* fix more tests

* add async version

* make 2 separate functions

* format

* fix

* format

* fix tests

* move resource

* changes

* fix cache

* lite fixes

* make lazy cache async

* fix

* fix

* flaky

* replace null with None

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-03 14:28:06 -07:00
Freddy Boulton
efd9524508
Fix gr.CheckboxGroup change event (#7915) 2024-04-03 07:19:58 -07:00
Shubham raj
b729f10321
Bugfix: Fix color and size keys in theme builder app (#7756)
* Bugfix: Update color and size keys in theme builder app

* add changeset

* add changeset

* changes

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabid94 <aabid94@gmail.com>
Co-authored-by: Ali Abid <aliabid94@gmail.com>
2024-04-02 21:09:05 +00:00
pngwn
bbdbd28453
chore: update versions (#7871)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-02 13:33:48 -04:00
Yuichiro Tachibana (Tsuchiya)
173c966866
Restore kitchen_sink test in the Lite E2E (#7904) 2024-04-02 23:43:59 +09: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
Ikko Eltociear Ashimine
83010a290a
fix typo in ci.md (#7894)
programatically -> programmatically
2024-04-01 11:08: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
Abubakar Abid
024b44c553
Add support for lazy caching of examples, as well as add GRADIO_CACHE_EXAMPLES env variable (#7863)
* lazy cache

* lazy cache

* add changeset

* changes

* changes

* helpers

* revert

* changes

* changes

* bash scriipt

* internal

* changes

* check

* setup

* fix

* lint

* add changeset

* revert

* fix

* fix test

* add changeset

* partial fix

* flaky

* lint

* change test

* add changeset

* change default behavior, add env

* set env correctly

* fixes

* format

* don't block event loop

* changes:

* get space

* add to chat interface

* add flag for deferring caching

* fixes

* lazy sync

* format

* added support in chat_interface

* add documentation

* fix test

* add test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-29 23:14:33 +00:00
Srilekha P
ceabe503dc
Adding hover to shadow-alternate on the cards on the website (#7891)
* Adding Hover to shadow-alternate

* style

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-29 16:14:20 -07:00