Commit Graph

6601 Commits

Author SHA1 Message Date
pngwn
9a87eb1992
Cs fix client (#8275)
* fix param name

* format

* fix cs
2024-05-13 15:43:21 +01:00
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
pngwn
30463c5e15
chore: update versions (#8225)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-10 19:31:04 +01:00
Hannah
e09b4e8216
Add support for passing keyword args to data in JS client (#8197)
* allow passing kwargs to data param

* add changeset

* tweak

* update data usage in client/js readme

* more readme tweaks

* edit codesnippet

* add changeset

* check parameters exist

* add changeset

* test

* remove null check

* remove test

* use api_info

* unit tests

* type tweak

* test

* remove unused vars

* tweak

* import semiver

* tests tweak

* format code snippet

* feedback changes

* format

* typefix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-10 19:46:28 +02:00
Freddy Boulton
c562a3d9a4
Cancel server progress from the python client (#8245)
* implementation + test

* add changeset

* WIP using events

* Use /cancel route

* Try bumping lite

* add changeset

* Fix stream closing issue

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-10 12:26:39 -04:00
Yuichiro Tachibana (Tsuchiya)
d62a48b183
Delete embedded Lite apps in the doc (#8232) 2024-05-10 15:50:38 +09:00
Dawood Khan
bf909bd145
Change upload icon for MultimodalTextbox (#8236)
* icon

* add changeset

* add changeset

* test fix

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 23:32:28 -04:00
Freddy Boulton
0a6f0a7e02
Fix custom component detection logic in analytics (#8254)
* Add code

* add changeset

* revert

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 23:49:51 +00:00
Yuichiro Tachibana (Tsuchiya)
32d915aad5
Apply clean_indent() to the file contents specified with <gradio-file> tags (#8219)
* Apply clean_indent() to the file contents specified with <gradio-file> tags

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 12:49:24 -05:00
Abubakar Abid
52dac637a3
Adds examples_per_page to gr.ChatInterface and allows clear_btn in gr.Interface to be hidden (#8244)
* add  to  and allow setting  to  in

* docs

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 10:23:27 -05:00
renovate[bot]
5a93d639f6
chore(deps): update mcr.microsoft.com/devcontainers/python docker tag to v1 (#8251)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-09 11:04:17 -04:00
Freddy Boulton
9ece050a70
Fix bug where updating a component's value in reload mode would not be shown in UI (#8227)
* Update code

* add changeset

* lint

* Add code

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 10:05:27 -04:00
pngwn
22df61a26a
Client node fix (#8252)
* fix client in node

* run all client tests in ci

* add changeset

* fix types

* add changeset

* format

* types

* add changeset

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-09 12:06:28 +01:00
Abubakar Abid
05fe4918c0
Allow Spaces with .success() to be gr.load-ed (#8242)
* fix success in gr.load

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-08 19:34:23 -05:00
Freddy Boulton
6ee1f1f721
Display all custom components in the gallery (#8224)
* Add code

* add changeset

* restore pnpm lock

* Empty

* new lockfile

* pin 9.0

* Test

* Fix action

* add changeset

* Update tests-js.yml

* remove limit

* revert pnpm-lock

* add changeset

* fix template issue

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-05-07 12:58:33 -04:00
Yuichiro Tachibana (Tsuchiya)
1a5bed2ffb
Delete frontend builds for the normal version before building Lite for faster and lighter build process (#8230) 2024-05-07 21:11:10 +09:00
Yuichiro Tachibana (Tsuchiya)
0493c66303
Split test/test_components.py into test/components/test_*.py (#8218)
* Split test/test_components.py into test/components/test_*.py

* Remove test/components/conftest.py because what it configures is already defined in pyproject.toml
2024-05-07 16:06:34 +09:00
Ali Abdalla
f176e1b509
Convert all demos on docs to lite (#8220)
* use lite for demos

* styling

* formatting

* add changeset

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-06 18:57:30 -07:00
renovate[bot]
892181b4fd
chore(deps): update dependency @types/prismjs to v1.26.4 (#8226)
* chore(deps): update dependency @types/prismjs to v1.26.4

* 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-05-06 19:58:12 -04:00
renovate[bot]
aedf0c8770
chore(deps): update pnpm to ~9.1.0 (#8221)
* chore(deps): update pnpm to ~9.1.0

* pin 9.1

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
2024-05-06 18:22:39 +00: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
pngwn
be2b1e1261
chore: update versions (#8172) 2024-05-03 19:06:05 +01:00
Freddy Boulton
3a6f1a50b2
Only connect to heartbeat if needed (#8169)
* Add connect_heartbeat field

* fix types

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 13:36:02 -04:00
Hannah
91b5cd6132
remove redundant event source logic (#8211)
* remove redundant event source logic

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 17:22:55 +01:00
Hannah
b9afe93915
Rename eventSource_Factory and fetch_implementation (#8209)
* rename eventSource_factory -> stream_factory + rename event_source -> steam

* rename fetch_implementation -> fetch

* rename fetch to _fetch due to global.fetch conflict

* add changeset

* format

* format

* format

* format

* fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 15:24:19 +02:00
pngwn
24b2286a22
allow the canvas size to be set on the ImageEditor (#8127)
* add canvas size kwarg to imageeditor

* add changeset

* fix tests

* fix cropsize

* changes

* notebooks

* update docstrings

* fix type

* fix undefined dimensions

* Update image_editor.py

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

* fix type

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-03 10:55:19 +01:00
renovate[bot]
f5b710c919
chore(deps): update dependency eslint to v9 (#8121)
* chore(deps): update dependency eslint to v9

* update deps + fix things

* add changeset

* fix preview

* add changeset

* lockfile

* format

* add changeset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 09:57:08 +01:00
Yuichiro Tachibana (Tsuchiya)
1435d1d2dc
Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (#8052)
* Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (wip: only object-detection in this commit)

* add changeset

* Add image-classification and image-segmentation

* Add zero-shot-image-classification and zero-shot-object-detection

* Add document-question-answering

* Add feature-extraction and fill-mask

* Add question-answering and summarization

* Fix an error message

* Add text2text-generation, text-classification, and text-generation

* Add translation andtranslation_xx_to_yy

* Add zero-shot-classification

* Add postprocess_takes_inputs to control the args passed to the postprocess function of each pipeline

* Add topk option to image-classification

* format_backend

* Add audio-classification, automatic-speech-recognition, and zero-shot-audio-classification

* Add image-to-text

* Add token-classification (with JSON component as an output. Is it correct?)

* Ignore import type failure of transformers_js_py

* Add image-feature-extraction

* Add image-to-image

* Add text-to-audio

* Add depth-estimation

* Remove `render=False`

* Reorder the if-blocks following the Transformers.js doc

* Update gradio/pipelines_utils.py

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

* Update gradio/pipelines_utils.py

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

* Fix feature-extraction demo

* Fix demo title

* Add guides/08_gradio-clients-and-lite/gradio-lite-and-transformers-js.md without contents

* Rename guides/08_gradio-clients-and-lite/*.md to fix the order

* Use pipeline.model.config._name_or_path for the demo title instead of pipeline.model.config.model_type

* Fix normal Interface.from_pipeline to use pipeline.model.config.name_or_path as the demo title

* Write an article about Gradio-Lite and Transformers.js

* Update the doc

* tweaks

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-03 07:37:51 +00:00
Yuichiro Tachibana (Tsuchiya)
cfc272ff79
Set the show_api flag on Lite (#8205)
* Set the show_api flag on Lite

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 00:24:49 -07:00
Yuichiro Tachibana (Tsuchiya)
376dfaaa80
Specify the fastapi version on Lite to avoid ujson installation which is not available on Pyodide yet (#8204)
* Specify the fastapi version on Lite to avoid ujson installation which is not available on Pyodide yet

* add changeset

* Refactoring

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-03 15:12:15 +09:00
Freddy Boulton
449d0e6e14
Refactor analytics to not use api.gradio.app (#8180)
* Analytics refactor

* add changeset

* add changeset

* Fix wasm?

* Fix python tests'

* Revert changes chrome

* use util function

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-02 20:29:19 -04:00
Freddy Boulton
72039be93a
Support custom components in gr.load (#8200)
* Add code

* add changeset

* Update fuzzy-mirrors-scream.md

* Update fuzzy-mirrors-scream.md

* Fix tests

* Update .changeset/fuzzy-mirrors-scream.md

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

* Fix code

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-02 23:07:45 +00:00
Hannah
cf52ca6a51
Ensure connectivity to private HF spaces with SSE protocol (#8181)
* add msw setup and initialisation tests

* add changeset

* add eventsource polyfill for node and browser envs

* add changeset

* add changeset

* config tweak

* types

* update eventsource usage

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

* dynamically import eventsource

* revet eventsource imports

* add jwt param to sse requests

* add stream test

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-02 23:05:56 +02:00
Hannah
7aca673b38
Add eventsource polyfill for Node.js and browser environments (#8118)
* add msw setup and initialisation tests

* add changeset

* add eventsource polyfill for node and browser envs

* add changeset

* add changeset

* config tweak

* types

* update eventsource usage

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

* dynamically import eventsource

* revet eventsource imports

* add node test

* lockfile

* add client test in root pkg file

* lcokfile

* remove eventsource from js/app

* add changeset

* remove ts ignore

* move eventsource polyfill to eventsource factory

* add changeset

* tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-02 22:49:55 +02:00
Tiger3018
5671ff129a
fix: handling SIGINT correctly in reload.py, single entrance of block_thread in blocks.py (#8158)
* fix: handling SIGINT, single block_thread and fix popen

* Use pass

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
2024-05-02 17:58:25 +00:00
James Zhou
2471f79527
run python reload only if python file changed (#8194)
* run python reload only if python file changed

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-05-02 17:42:41 +00:00
Abubakar Abid
39791eb186
Convert sse calls in client from async to sync (#8182)
* convert sse calls in client from async to sync

* add changeset

* more sync

* lint

* more sync

* fix threadpool

* fix timeouts

* reuse executor

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-01 21:48:49 -07:00
Freddy Boulton
d0a759f3df
Pass Error status in /dev/reload stream (#8106)
* get error message

* Support multiple clients

* add changeset

* add changeset

* add changeset

* Display in UI

* console.error the python traceback

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-01 22:21:54 +00:00
Ali Abdalla
68dcae512c
Use workspace version for code in _website (#8189)
* workspace

* add changeset

* remove circular import from preview

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-01 14:17:56 -07:00
renovate[bot]
0d2e71bed4
chore(deps): update pnpm to v9 (#8123)
* chore(deps): update pnpm to v9

* update workflow

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-05-01 18:25:25 +01:00
pngwn
6a218b4148
rework upload to be a class method + pass client into each component (#8179)
* rework upload to be a class method + pass client into each component

* add changeset

* Update client/js/src/utils/upload_files.ts

* fix storybook

* review comments

* Apply suggestions from code review

Co-authored-by: Hannah <hannahblair@users.noreply.github.com>

* format

* ts fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2024-05-01 14:55:41 +00:00
Lê Ngọc Hoa
a0e70366a8
Update test-functional.yml - Fix vulnerability code injection (#8145)
* Update test-functional.yml

* Update test-functional.yml

* tweaks

---------

Co-authored-by: pngwn <hello@pngwn.io>
2024-05-01 14:41:27 +00:00
Yuichiro Tachibana (Tsuchiya)
a81e36967c
Remove hatch installation in js/app/package.json which is no longer needed (#8174)
* Remove hatch installation in js/app/package.json which is no longer needed

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-01 07:45:38 +09:00
Hannah
bed2f82e22
Implement JS Client tests (#8109)
* add msw setup and initialisation tests

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-30 18:50:38 +02:00
Freddy Boulton
08b4e61723
Add ETag to /custom_component route to control browser caching (#8170)
* Add code

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-30 10:22:28 -04:00
Yuichiro Tachibana (Tsuchiya)
611c9273a3
Lite wheel optimization (#7855)
* Add `pull_request.branches.main` as a trigger of the `publish` workflow

* [WIP] Comment out the publish steps

* Package and upload the NPM package for debug

* Skip the copy_frontend.py hook in the Lite build

* add changeset

* [WIP] Show gradio files

* [WIP] Show gradio files

* Comment out installing the gradio and gradio_client libraries

* Restore installing gradio_client because it's used by `python js/_website/generate_jsons/generate.py` that follows

* Restore installing gradio because it's used by `python js/_website/generate_jsons/generate.py` that follows

* Add code

* Revert "[WIP] Show gradio files"

This reverts commit e15fef29bd14671576e64d94d3b844786ebe7e83.

* Build the gradio wheel with the custom lite target

* add changeset

* Revert "[WIP] Show gradio files"

This reverts commit aef053f9caad203c7e1bbfa15e9f9e536f77442a.

* Revert "Skip the copy_frontend.py hook in the Lite build"

This reverts commit ca296d0e4e169adbb6af3705561869aa8c9037b7.

* Update .github/actions/install-frontend-deps/action.yml for hatch installation

* [WIP] Fix test-functional.yml and .github/actions/install-all-deps/action.yml to call the setup actions in this branch

* Revert "[WIP] Fix test-functional.yml and .github/actions/install-all-deps/action.yml to call the setup actions in this branch"

This reverts commit 571823b4a05f7e41e0b3731d51c5bd86b2e17ddc.

* Comment-in lines in publish.yml

* Move Lite build from publish.yml to deploy-spaces.yml

* Use the build_lite option of install-all-deps instead of running the build command

* [TMP] Change the branch of action files

* Fix the hatch Lite build setting

* Return pnpm pack to deploy-space

* Revert "[TMP] Change the branch of action files"

This reverts commit fe4e1c8f210eb21ac7ee1bd4b219d35e1ae84c85.

* Remove dependencies for lite build

* [TMP] Change the branch of action files

* Revert "Remove dependencies for lite build"

This reverts commit 856a858c1f49d736bfeb056ba0ec7e9bc35af29c.

* Install packaging>=23.2

* [TMP] Show packaging version

* Fix pip install

* Fix

* Uninstall packaging once

* Use `pip install -U` instead of uninstalling the exiting version

* Revert "[TMP] Show packaging version"

This reverts commit 910b6bbde3dc8777c051bd5576813913d57959f7.

* Add `-U` flag

* Set packaging version as >=23.2

* Revert the changes on pip install

* Set packaging version as >=23.2 in requirements.txt

* Revert "Set packaging version as >=23.2"

This reverts commit 8aa77c8930815e69d7256886cad88b6da8361069.

* Fix hook name

* Revert "Set packaging version as >=23.2 in requirements.txt"

This reverts commit fbd605cbfb5d06706eacc0648a2e9d7816c9de1f.

* Revert "Revert the changes on pip install"

This reverts commit 81ff38a660635fce9cb17862a2072e4d169c3466.

* Add comments

* Revert "[TMP] Change the branch of action files"

This reverts commit 0d6aa48d75a842db9b3987212deffedb0c0ca51d.

* Revert the trigger of .github/workflows/deploy-spaces.yml

* Remove unused `node_auth_token` and `npm_token` inputs from the `install-all-deps` action

* [TMP] Trigger CI based on this PR

* Remove packging installation

* Revert "Remove packging installation"

This reverts commit 4a4f18de3a.

* Revert "[TMP] Trigger CI based on this PR"

This reverts commit 6cea830c8e.

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
2024-04-30 03:18:13 +00:00
Simon Duerr
989fe2566f
Make guide for tailwind more verbose (#8152) 2024-04-30 03:35:22 +01:00
Freddy Boulton
9a5728ca2b
Update docs on max-threads (#8166) 2024-04-29 14:39:16 -04:00
James Zhou
ba15bde44c
add flag for hot reload example (#8155) 2024-04-29 11:11:16 -04:00
pngwn
d9afb0ff32
chore: update versions (#8147)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-26 19:17:13 +01:00