Commit Graph

58 Commits

Author SHA1 Message Date
Abubakar Abid
d65512cb3a
Fix output directory of files in client & when calling Blocks as function (#4501)
* output dirs

* remove

* remove

* remove

* changelog

* format

* add tests

* docstring

* changelog

* client

* blocks

* fix test
2023-06-14 17:08:10 -05:00
Freddy Boulton
afcc20801e
Deprecate python 3.7 (#4484)
* Remove versions from 3.7

* CHANGELOG

* from typing import Literal

* Remaning places 3.7

* Last few spots

* Use 3.8 in lint
2023-06-13 21:52:33 -04:00
Freddy Boulton
4a58ccee39
Fix bug where file examples can be corrupted if has multiple extensions (#4440)
* Fix bug

* Add to changelog

* Add test

* Remove breakpoint

* fix test

* increment version

* update client version req

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-06-07 15:05:01 -05:00
WilliamRoyNelson
e364f81ffc
Increase version gradio-client version/changelog (#4441)
* Increase version gradio-client version/changelog

* req

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-06-07 14:18:32 -05:00
Freddy Boulton
bc6a1fad1c
Call mounted gradio app via api (#4435)
* Fix bug

* Add changelog
2023-06-06 10:40:56 -05:00
WilliamRoyNelson
20d066c0da
Add pypi classifiers to client pyproject.toml (#4409)
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-06-05 17:46:35 -05:00
Freddy Boulton
834afdd303
Temp file fixes (#4256)
* Fix bug

* Linting

* CHANGELOG

* Add tests

* Update test

* Fix remaining components + add tests

* Fix tests

* Fix tests

* Address comments
2023-05-20 06:22:12 +09:00
Aarni Koskela
9ece3b43b9
Upgrade black to 23.3 (#4259)
* Upgrade black

* Conservatively upgrade packaging too since it's black's dependency
2023-05-18 11:04:59 -04:00
Abubakar Abid
d6c93228d9
Some tweaks to the Client (#4230)
* parameter names

* tweaks

* separate out serialize

* fix

* changelog

* fix

* fix

* improve test
2023-05-16 14:32:42 -04:00
Abubakar Abid
fcf744a4a9
hotfix for test (#4173)
* hotfix for test

* removed comment
2023-05-11 16:49:41 -05:00
Tom Aarsen
02bd90d7c1
[Docs] Resolve numerous typos (#4170)
* Resolve numerous typos

* Delete test.py

* Run generate_notebooks

* notebooks

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-11 15:20:41 -05:00
Abubakar Abid
e6198752c6
Adds missing components to gradio client serializing's component mapping (#4167)
* add missing serialization

* format

* update release note format

* update release note format

* fix test
2023-05-11 11:33:14 -05:00
Abubakar Abid
253410c78d
simplify format of changelog (#4163) 2023-05-11 08:11:49 -05:00
Freddy Boulton
3227a9b703
Fix api info for File component (#4153)
* Fix output file type info

* Fix example inputs

* CHANGELOG

* Update client

* Add test

* Bump version

* Bump min client version
2023-05-10 19:52:07 -04:00
Freddy Boulton
5e2c3c9ed6
Fix python client test (#4138)
* Fix python client test

* CHANGELOG

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-10 10:13:52 -05:00
Freddy Boulton
a65c4b5927
Bumpt client version (#4125) 2023-05-09 12:53:33 -04:00
Freddy Boulton
c7f4a88150
Dont send request to /info if version before 3.28.3 (#4109)
* Add code

* Lint

* CHANGELOG

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-08 17:18:28 -04:00
Abubakar Abid
dccf68d914
Removing "State" from view API info (#4107)
* wip pr

* update client version

* update space fetcher

* changelog, workflow

* fix not flaky tests

* lint

* v2
2023-05-08 15:47:40 -05:00
Freddy Boulton
b66ecff671
[WIP] Language Agnostic Typing in /info route (#4039)
* First commit

* All serializers

* Remove output type

* Add route

* Format json

* Modify dropdown and slider choices

* Fix impl

* Lint

* Add tests

* Fix lint

* remove breakpoint

* Tests passing locally

* Format code

* Address comments

* Use union + fix tests

* handle multiple file case

* Add serializer to info payload

* lint

* Add to CHANGELOG

* grc version

* requirements

* fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-05 19:10:34 -05:00
Aarni Koskela
d1853625fd
More Ruff rules (#4038)
* Bump ruff to 0.0.264

* Enable Ruff Naming rules and fix most errors

* Move `clean_html` to utils (to fix an N lint error)

* Changelog

* Clean up possibly leaking file handles

* Enable and autofix Ruff SIM

* Fix remaining Ruff SIMs

* Enable and autofix Ruff UP issues

* Fix misordered import from #4048

* Fix bare except from #4048

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-04 21:54:23 -05:00
Aarni Koskela
4d629f04cc
Upgrade pyright to 1.1.305 (#4042) 2023-05-02 13:20:35 -05:00
1lint
f97b18ec9d
Allow decoding b64 string without header in processing utils (#4031)
* allow decoding b64 string without headers

* install gradio-client in edittable mode

* update GH actions

* add test for decoding headerless b64

* add test for decoding headerless b64 image

* some linting

* fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-01 18:24:54 -05:00
Aarni Koskela
12a97746ff
Ruff update + strictening (#3979)
* Update ruff to 0.0.263

* Get rid of bare except:s

* Fix two Ruff E731s by moving expand_{color,size} to the relevant classes

* Fix Ruff E731 and some variable shadowing in theme builder

* Fix remaining Ruff E731s

* Get rid of unused Ruff ignores

* Fix ruff B904 issues (raise from)

* Fix Ruff B007: loop-control variable not used

* Fix Ruff B011 (do not assert false)

* Remove unused args and kwargs from Progress.tqdm() (spotted via Ruff B026)

* Fix mutable argument default in CheckboxGroup

* Noqa ABC-related lint warnings for Interpretable

* Add missed assert in test_queueing (ruff B015)

* Enable ruff B

* Enable ruff C and fix issues

* Add changelog

* Add UP03[012] after #3984

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-28 17:59:42 -04:00
Abubakar Abid
847247e1dd
version (#3990) 2023-04-27 16:35:55 -04:00
Freddy Boulton
2a59ec04fa
Fix view_api bug where unnamed rotes where showing api_name instead of fn_index (#3972)
* Fix view_api bug

* Add to changelog

* Rework test
2023-04-26 18:38:46 -04:00
Aarni Koskela
37d52a753c
CI: only run backend lints once, not in all test environments (#3960)
* CI: only run backend lints once, not in all test environments

* Add needses
2023-04-26 15:41:06 -04:00
Freddy Boulton
f886045535
Use local demos for client tests (#3975)
* Fix tests

* Fix tests

* Address comments
2023-04-26 11:11:28 -04:00
Freddy Boulton
d835c9a816
Support gr.Progress() in python client (#3924)
* Add progress message

* CHANGELOG

* Dont use pydantic

* Docs + local test

* Add gr to requirements

* Remove editable install

* make a bit softer
2023-04-24 12:52:10 -04:00
Tenzin
3b114cbc2b
Fixes typos (#3931)
* Fixes typos

* Update CHANGELOG.md

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2023-04-21 11:00:57 -04:00
Abubakar Abid
7a04ebe7fd
Fix some documentation-related issues in Guides (#3903)
* client doc fixes

* simplify demo

* added guides

* chatbot guide

* notebooks

* format
2023-04-19 14:38:11 -04:00
Abubakar Abid
1f246d9d1e
changelog 0.1.3 (#3862) 2023-04-14 17:47:43 -07:00
Freddy Boulton
7ef0439d3c
Fix video serializing in client (#3860)
* Fix video serializing in client

* Add to changelog

* Remove print
2023-04-14 17:07:19 -07:00
Abubakar Abid
d3b7f73bcf
Update view api page to use Python client (#3765)
* Update view api page

* simplify

* update

* changes

* changes

* updated info

* formatting

* changes

* fixes

* save

* moved

* remove test input

* tweaks

* formatting

* add raw

* serialize

* fixes

* refactor

* fixes

* fixes

* Fetch api

* lower case

* view api

* fix tests

* format

* rough design

* readme

* api docs

* examples

* format

* formatting

* format

* version

* client changes

* formatting

* update client

* more example inputs

* api docs fixes

* remove notebook

* fix demo

* demo notebook

* styling on code snippet

* formatting

* fix audio, model3d

* format

* fix tests

* version

* cleanup

* format

* format

* format

* fixes

* version

* fix tests

* version

* format

* test

* format

* changelog

* changelog

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2023-04-13 16:20:33 -07:00
Abubakar Abid
40b30a683b
[WIP] Client duplicate fixes (#3843)
* client duplicate fixes

* fixes

* formatting

* changes

* fixing tests

* formatting
2023-04-13 12:30:11 -07:00
Abubakar Abid
9f4f851d68
Python client Guide (#3788)
* guide

* guide

* Apply suggestions from code review

Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>

* add cancel

* remove duplicated docs

* updates

---------

Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2023-04-12 13:44:38 -07:00
Abubakar Abid
c3e239fca0
changelog for client (#3761) 2023-04-12 13:35:34 -07:00
Abubakar Abid
52d0885937
Allow client to be duplicated from an existing Space (#3809)
* client

* readme

* readme

* fixes

* cleanup

* error messages

* format

* updates

* format

* build

* fixes

* fix tests

* Update client/python/gradio_client/client.py

Co-authored-by: aliabid94 <aabid94@gmail.com>

* set timeout

* rename

* format

* rename

* sleep timeout

* format

* mock secrets

* format

* format

* docstring

* fix test

---------

Co-authored-by: aliabid94 <aabid94@gmail.com>
2023-04-12 13:26:37 -07:00
Freddy Boulton
00d7a5ce24
Python Client: Handle invalid space state (#3822)
* Raise error on status check

* Add BUILDING

* Remove SLEEPING
2023-04-11 22:38:17 -04:00
Greysuki
54af6ae290
Adding subtitles to gr.Video (#3673)
* v2 version now accepts video and subtitle format inputs.

* remove debug log and some format issue

* Update CHANGELOG.md

* Upload components.py and regenerate demo

* fix components and add comment to function

* fix postprocess return format

* changelog

* demo change to gr.Interface type

* fix file_types

* fixes

* added video serializer

* clean up preprocess

* clean up postprocess

* formatting

* frontend

* fixed serialization

* dataclass

* fix serialize

* version

* fix tests

* version

* changelog

* typing

* version

* changelog

* version

* versin

* fix tests

* fix tests

* backend

* test

* changes

* relax test

* fix demo

* notebook

* changes

* fix

* changes

* Update gradio/components.py

* Update client/python/gradio_client/client.py

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-04-11 16:06:48 -07:00
Freddy Boulton
72c9636370
Python client cancel jobs (#3787)
* Working impl

* Add tests:

* formatting

* Fix typo

* Always reset iterator state

* Add httpx

* Fix test

* Fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-09 07:22:49 -07:00
Freddy Boulton
1def8df6dd
Python Client: Upload files via /upload for File components (#3771)
* Add tests

* Fix tests

* Remove redundant test

* fix for windows

* Add tests

* Fix tests

* Remove redundant test

* fix for windows

* Add uploadbtn

* Add support for upload btn

* revert

* Add size to FileSerializable

* Serialize multiple files

* lint

* Make changes to deserialize

* Fix multiple file upload case

* Modify test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-07 19:42:59 -04:00
Abubakar Abid
b456feb5c4
Py client verbose (#3781)
* verbose flags

* fixes
2023-04-06 16:41:37 -07:00
Abubakar Abid
5f8186218c
Document python client in gradio.app/docs (#3764)
* document py client

* more changes

* update docs

* changes

* fix tests

* formatting

* stash

* fix tests

* documentation

* more docs

* gradio client

* changes

* rework documentation

* add to docs

* modify dockerfile

* gradio client

* address feedback

* formatting

* gradio client version

* fix tests

* tweaks to website

---------

Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2023-04-06 12:58:42 -07:00
Freddy Boulton
a828b6088c
Make Client Jobs Iterable (#3762)
* Add iterator

* Break if done

* Add test for early termination
2023-04-05 14:19:05 -04:00
Freddy Boulton
9325cba14c
Get Intermediate Results from Python Client (#3694)
* Add status + unit test (flaky) for now

* Install client

* Fix tests

* Lint backend + tests

* Add non-queue test

* Fix name

* Use lock instead

* Add simplify implementation + fix tests

* Restore changes to scripts

* Fix README typo

* Fix CI

* Add intermediate results to python client

* Type check

* Typecheck again

* Catch exception:

* Thinking

* Dont read generator from config

* add no queue test

* Remove unused method

* Fix types

* Remove breakpoint

* Fix code

* Fix test

* Fix tests

* Unpack list

* Add docstring

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-04 17:58:25 -04:00
Abubakar Abid
c4ad09b631
Adds a pypi release action for the gradio python client (#3743)
* release action

* fixes

* name

* Update version.txt

* Update version.txt

* update

* fixes

* version

* rename

* action

* fix token

* custom dir

* fixes

* change password

* revert back to token

* scripts

* remove twine
2023-04-04 13:51:51 -07:00
Freddy Boulton
070b304e09
CI tweaks (#3752) 2023-04-04 14:02:20 -04:00
Freddy Boulton
46ee226d8c
Add root_url to serializers in gradio_client (#3736)
* Add root_url to serializers

* Add url fix

* Respect fn parameter

* Fix docstring

* Add other test

* Pass to method
2023-04-04 13:35:12 -04:00
Freddy Boulton
b97a61b83a
Import Literal from typing extensions in client (#3741)
* Fix typing extensions

* Import typing_extensions

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-03 19:17:00 -07:00
Aarni Koskela
ef3862e075
Switch linting to Ruff (#3710)
* Sort requirements.in

* Switch flake8 + isort to ruff

* Apply ruff import order fixes

* Fix ruff complaints in demo/

* Fix ruff complaints in test/

* Use `x is not y`, not `not x is y`

* Remove unused listdir from website generator

* Clean up duplicate dict keys

* Add changelog entry

* Clean up unused imports (except in gradio/__init__.py)

* add space

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-03 15:48:18 -07:00