Commit Graph

6567 Commits

Author SHA1 Message Date
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
pngwn
7ba2780dc0
fix missing dependencies for @gradio/preview (#8144)
* mopre fix

* add changeset

* add changeset

* fix lockfile

* fix all

* Update .changeset/silent-cases-brush.md

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-26 17:45:29 +00:00
pngwn
cbbb44283b
chore: update versions (#8143)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-26 14:07:47 +00:00
pngwn
44eb8ac6c3
ensure @gradio/preview dist files are published (#8142)
* fix build again

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-26 13:53:21 +00:00
pngwn
020c65e8e1
chore: update versions (#8141)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-26 12:53:44 +00:00
pngwn
0d41b221dc
fix publish build (#8140)
* fix publish build

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-26 13:38:53 +01:00
Yuichiro Tachibana (Tsuchiya)
c452acb0f6
Add tests for Lite custom element parser (#8081)
* Add tests for Lite custom element parser

* Fix the tests to detect the error #8067 fixed
2024-04-26 09:55:48 +09:00
pngwn
dfd03f38bd
chore: update versions (#8069)
* chore: update versions

* Revert @gradio/code

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-04-25 23:08:27 +00:00
Yuichiro Tachibana (Tsuchiya)
595ebf74c5
Cache an error from app.submit() and show it on frontend (#8115)
* Cache an error from app.submit() and show it on frontend

* Fix typing

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-25 22:26:06 +01:00
Freddy Boulton
0efd72e608
Add Analytics for custom components (#8130)
* Analytics

* add changeset

* add changeset

* Add code

* Modify pnpm

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-25 20:51:50 +00:00
pngwn
15a7106a36
allow custom component authors to provide custom vite plugins and svelte preprocessors (#6787) 2024-04-25 19:58:42 +01:00
aliabid94
2e469a5f99
Using keys to preserve values between reloads (#8056)
* changes

* add changeset

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* rev pn

* 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-04-25 11:25:53 -07:00
pngwn
0a42e96537
Allow users to template the ImageEditor when using custom components (#8133)
* fix image editor template for cc

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-25 17:08:14 +00: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
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