Commit Graph

172 Commits

Author SHA1 Message Date
aliabid94
2943d6d688
Add Timer component (#8505)
* chagnes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* add docs

* add changeset

* remove demo

* add changeset

* add changeset

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* Update gradio/components/timer.py

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

* 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: aliabd <ali.si3luwa@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-06-28 16:53:44 -07:00
pngwn
12f81fcaed
chore: update versions (#8622)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-28 12:39:54 -04:00
Hannah
4b6c8b1c00
ensure File objects are handled in JS client handle_file (#8649)
* amend `File` datatype logic

* add changeset

* amend test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-28 16:41:44 +01:00
pngwn
4cfb6eebf6
chore: update versions (#8523)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-25 11:54:46 -04:00
Josh Wong
7289c4b036
Add credentials: include and Cookie header to prevent 401 error (#8600)
* Add credentials: include and Cookie header to prevent 401 error

* FIx formatting

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-24 23:42:03 +01:00
pngwn
900cf25256
Ensure frontend functions work when they don't return a value (#8521) 2024-06-21 09:17:10 +01:00
baojianting
a77877f62d
First time loading performance optimization (#8571)
* performance: add gradio_api_info

* format code

* fix ts check

* fix ts check

* add changeset

* add changeset

* format globals.d.ts

---------

Co-authored-by: jianting.bjt <jianting.bjt@alibaba-inc.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-06-20 09:38:40 +01:00
Freddy Boulton
7fc0f5149b
Fix reload mode by implementing close on the client (#8548)
* Fix reload mode

* add changeset

* reload test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-13 17:35:33 -04:00
Freddy Boulton
c2a0d056d6
Control Display of Error, Info, Warning (#8489)
* first draft

* handle animation

* No animation

* Add code

* add changeset

* Only use duration

* lint

* lint

* Add docs

* add changeset

* Fix default

* sample usage

* formatting

* Add visible parameters

* float

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-06-11 23:27:59 +00:00
pngwn
bdaa678d0c
add handle_file docs (#8522) 2024-06-10 20:16:55 +01:00
pngwn
18a5e0e162
chore: update versions (#8497)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-09 09:48:41 -07:00
aliabid94
c5f6e7722a
Cache break themes on change (#8499)
* 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>
2024-06-09 08:31:03 -07:00
pngwn
f9406b46e3
chore: update versions (#8482)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-06 08:15:46 -07:00
pngwn
e2271e207d
documentation for @gradio/client (#8483)
* fix param name

* format

* docs

* add changeset

* Update client/js/README.md

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

* add changeset

* Apply suggestions from code review

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

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2024-06-06 14:58:20 +00:00
pngwn
f8ebacecce
Ensure all status are reported internally when calling predict (#8485)
* fix param name

* format

* fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-06 14:57:00 +00:00
pngwn
b301ce418b
chore: update versions (#8458)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-06 07:06:28 -07:00
pngwn
d5a9604930
Fix js client bundle (#8477)
* fix param name

* format

* fix build

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-06 12:39:22 +00:00
pngwn
9d2d6051ca
Change client submit API to be an AsyncIterable and support more platforms (#8451)
* fix param name

* format

* save

* changes

* changes

* fix param name

* format

* switch to async iterable interface

* switch to async iterable interface

* changes

* add changeset

* fix

* fix param name

* format

* fixes

* fix checks

* fix checks

* add changeset

* fix checks

* add changeset

* add changeset

* fix checks

* fix param name

* format

* fix types

* cleanup comments

* add changeset

* fix param name

* format

* changes

* Refactor Cancelling Logic To Use /cancel (#8370)

* Cancel refactor

* add changeset

* add changeset

* types

* Add code

* Fix types

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* fix param name

* format

* changes

* fix

* fix param name

* format

* fix test

* fix notebooks

* fix type

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-06-06 13:16:14 +01:00
Hannah
6447dface4
Improve file handling in JS Client (#8462)
* add handler for URLs, Blobs and Files

* add changeset

* remove NodeBlob

* add local file handling

* handle buffers

* add test

* type tweaks

* fix node test with file

* test

* fix test

* handle nested files

* env tweaks

* tweak

* fix test

* use file instead of blob

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-06 12:56:16 +01:00
Freddy Boulton
48eeea4eaa
Refactor Cancelling Logic To Use /cancel (#8370)
* Cancel refactor

* add changeset

* add changeset

* types

* Add code

* Fix types

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-05 15:32:24 -04:00
Hannah
63d36fbbf4
Handle gradio apps using state in the JS Client (#8439)
* send `null` for each `state` param in space api

* add changeset

* test

* remove state value from payload from server

* tweak

* test

* test

* Revert "test"

This reverts commit 182045ec7c.

* Revert "test"

This reverts commit 70e074dfdd.

* fixes

* add changeset

* fixes

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-06-05 11:53:06 +02:00
pngwn
bc1eff12c1
chore: update versions (#8420)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-30 14:55:23 -07:00
aliabid94
227de35298
Fix spaces load error (#8415)
* changes

* add changeset

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-30 13:52:50 -07:00
pngwn
b67f7ff8f9
chore: update versions (#8348) 2024-05-30 00:00:00 +01:00
Freddy Boulton
e86dd01b6e
Connect heartbeat if state created in render. Also fix config cleanup bug #8407 (#8408)
* Add code

* add changeset

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-29 17:49:03 -04:00
aliabid94
945ac837e7
Improve rendering (#8398)
* 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

* changes

* js

* remove console log

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* chnages

* changes

* cnages

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* Add `state.change` listener (#8297)

* state changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* updates

* changes

* add changeset

* changes

* changes

* add changeset

* fix

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* 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-29 11:24:57 -07:00
Hannah
d078621928
Add CDN installation to JS docs (#8401)
* add cdn copy

* add changeset

* tweak

* tweak

* add changeset

* Update guides/08_gradio-clients-and-lite/02_getting-started-with-the-js-client.md

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

* remove version from cdn link

* tweak

* tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-29 18:11:29 +00:00
aliabid94
55f664f297
Add event listener support to render blocks (#8243)
* 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

* changes

* js

* remove console log

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* chnages

* changes

* cnages

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* Add `state.change` listener (#8297)

* state changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* changes

* 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>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-22 14:51:53 -07:00
Hannah
1f8e5c44e0
Improve URL handling in JS Client (#8258)
* amend endpoint logic

* add changeset

* improve url joining for local URLs

* handle relative paths

* use join_urls in /info  to ensure correct endpoints

* add relative url logic and throw error for node

* tweaks

* remove relative paths support (wont work)

* tweak

* tweak func to throw error and amend tests

* tweak

* accomodate . in space names

* replace error with const msg

* tweak tests with error var

* revert map() to reduce() due to misinterpreted base URL

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-22 18:47:29 +01:00
Hannah
ab65360804
Allow JS Client to work with authenticated spaces 🍪 (#8299)
* get cookie from /login and apply to fetch requests in connect + duplicate funcs

* add error msg

* add tests

* improve error msgs

* remove unused var

* add changeset

* remove comment

* add error msg

* add private space test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-22 11:02:56 +01:00
pngwn
fe91e10269
chore: update versions (#8335)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-21 21:01:35 +00:00
Liam Dyer
47012a0c4e
ensure the client correctly handles all binary data (#8322)
* fix: walk blobs ignoring blobs in arrays directly

* add changeset

* fix function

* add changeset

* address review comments

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-05-21 20:11:35 +00:00
Liam Dyer
4d78f29666
fix: zero gpu auth ignoring hf_token (#8323) 2024-05-20 13:58:46 +01:00
pngwn
11b88915d3
chore: update versions (#8291)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-16 00:23:53 +02:00
pngwn
929d216d49
always create a jwt when connecting to a space if a hf_token is present (#8296)
* fix param name

* format

* always create a jwt if a hf token is present

* add changeset

* add changeset

* remove throw

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-15 16:20:34 +02:00
renovate[bot]
7c81897076
chore(deps): update dependency esbuild to ^0.21.0 (#8229)
* chore(deps): update dependency esbuild to ^0.21.0

* 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-14 13:05:39 -07:00
pngwn
053316dd0f
chore: update versions (#8286)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-14 12:45:39 +00:00
pngwn
7d9d8eab50
use the correct query param to pass the jwt to the heartbeat event (#8285)
* fix param name

* format

* fix jwt queryparam

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-14 12:20:07 +00:00
pngwn
ca8864f514
chore: update versions (#8274)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 23:23:49 +00: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
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
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
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
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