Commit Graph

111 Commits

Author SHA1 Message Date
Abubakar Abid
56da69619c
Fix for analytics error (#4738)
* added exception

* fix

* changelog

* format

* blocks

* format

* Update gradio/exceptions.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* review fixes

* formatting

---------

Co-authored-by: Aarni Koskela <akx@iki.fi>
2023-06-30 16:16:55 -05:00
Abubakar Abid
409593e9cc
Updates to the API endpoints / docs, and fixing the Theme builder (#4683)
* view API fixes

* code snippet js

* changelog

* api name false

* examples

* client trigger tests

* fix typecheck

* black

* type

* typing

* typing

* update gif

* type ignore

* added tests

* format

* added test

* test

* fix guides

* snippet

* tests

* fix tests

* add test

* fix typing

* fix test

* remove comments
2023-06-29 14:05:25 -05:00
Jeb
d85fddf677
Updated components with 'info' attribute to update when update() is called on them. (#4715)
* updated components with 'info' attribute to update when update() is called on them.

* added change to CHANGELOG.md

* updated CHANGELOG.md with correct format ending

* fix test

* changelog

---------

Co-authored-by: pngwn <hello@pngwn.io>
2023-06-29 11:09:55 +01:00
Ilya Trushkin
b5121a96b2
Forward tqdm constructor arguments to Progress component (#4475)
* Forward tqdm constructor arguments to Progress component

Signed-off-by: Ilya Trushkin <ilya.trushkin@intel.com>

* lint

* reorder args

* added tests

---------

Signed-off-by: Ilya Trushkin <ilya.trushkin@intel.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-06-26 09:26:28 -05:00
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
pngwn
3d334e245f
implement autoplay for Video and Audio (#4453) 2023-06-09 08:27:58 +09:00
aliabid94
ff6e676a92
Remove style parameter (#4374)
* changes

* changes

* changes

* changes

* changes

* changes

* fixes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes
2023-06-07 18:35:31 -07:00
Abubakar Abid
37967617bd
Restrict proxy URLs (#4406)
* restrict proxy urls

* fix test

* changelog

* fix tests

* Update gradio/routes.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* Update gradio/routes.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* fix test

* docstring

* bring back hf url

* fix tests

* Update gradio/blocks.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* Update gradio/blocks.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* fix tests

* nit

* fix test

* format

---------

Co-authored-by: Aarni Koskela <akx@iki.fi>
2023-06-05 12:51:33 -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
Aarni Koskela
8b72e9e127
Do not do any analytics requests if analytics are disabled (#4194)
* Move analytics-related bits to gradio.analytics

* Do not do any analytics requests if analytics are disabled

* Remove unused log_feature_analytics

* removed redundant analytics, rewrote

* renamed

* save

* fixed test'

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-16 02:55:46 -04:00
Freddy Boulton
96c17a7470
Add support for async generators (#3821)
* Add impl + unit test

* CHANGELOG

* Lint

* Type check

* Remove print

* Fix tests

* revert change

* Lint

* formatting

* Fix test

* Lint

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-05-08 23:21:47 -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
Abubakar Abid
f1ea4f79af
Allow state to be rendered multiple times (#4030)
* state render

* add test

* formatting

* changelog
2023-05-01 17:53:51 -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
Aarni Koskela
d25226f704
Use f-strings where possible (#3984)
* Use f-strings where possible

Semi-automated using ikamensh/flynt

* Update gradio/utils.py

* Update gradio/interface.py

* formatting

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-27 16:09:50 -04:00
Freddy Boulton
7de41d94bb
After closing demo, reuse port if its specified (#3959)
* Reuse port when its specified after closing demo

* Add to changelog

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-25 10:07:35 -04: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
aliabid94
379b6f662e
Get Image click coordinates from .select (#3786)
* changes

* changes

* fix demo notebook

* changes

* changes

* chagnes

* changes

* changes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-10 14:47:33 -07:00
space-nuko
303b4dc0b5
Improve error messages for when argument lists mismatch (#3519)
* Improve error messages for when argument lists mismatch

* Fix comment

* Update changelog

* Fix typeerror

* Fix single output case

* Add argument validation tests

* Lint

* Move changelog to correct section

* Fix typo

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
2023-04-07 13:22:42 -04: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
Abubakar Abid
2a8c82de01
Documentation-related fixes to the python client (#3663)
* docstring

* add documentation

* added more serialization classes

* format

* info

* is valid

* formatting

* changes

* fixups

* fix tests

* machine readable

* formatting

* client

* format

* tweaks on printing

* version

* linting

* fix tests

* update pypi requirements

* updates

* type ignore'

* fixes

* formatting
2023-03-29 15:00:20 -07:00
Abubakar Abid
dc37ddb739
fix sort script (#3696)
* fix sort script

* formatting

* script
2023-03-29 16:39:40 -04:00
space-nuko
df98c443f7
Fix default parameters value and gr.Progress in same function (#3671)
* Fix default parameters value and gr.Progress in same function

* Update changelog

* Fix tests

* Format

* Expand tests for other types of special function arguments

* Augment SelectData tests

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-28 19:37:38 -07:00
Freddy Boulton
ceb5853480
Raise errror if event queued but queue is not enabled (#3640)
* Raise Error

* CHANGELOG

* Add progress tracking validate_queue_settings

* Update gradio/blocks.py

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

* Fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-27 18:01:02 -07:00
Abubakar Abid
b1f8d11e4e
Fix windows flake (#3650)
* fix windows flake

* format backend

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2023-03-27 17:36:43 -07:00
space-nuko
e6ea19dee9
Add Windows CI (#3628)
* Add Windows CI

* Update changelog

* fix

* Skip one test on Windows

* Preserve virtualenv path

* Skip another test on Windows

* Make conditional flaky

* Requested changes

* consistent os

* cleanup

* fix test for windows

* remove unnecessary check

* lint

* lint

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-27 11:55:59 -07:00
Abubakar Abid
1c8d3cb05d
Simplify tests (#3608)
* simplify tests

* imports

* imports

* formatting

* removed cometml typing

* simplify

* changelog
2023-03-24 12:39:30 -07:00
Abubakar Abid
7a4e22b61a
Fixes Blocks exit issue (#3600)
* fix

* changelog

* blocks

* formatting
2023-03-24 09:48:32 -07:00
Freddy Boulton
8ec2b0b98a
Sharing themes (#3428)
* Rebase

* Remove build hooks

* Working implementation

* Add semver + unit tests

* CHANGELOG

* Add to docs

* Rename push_to_hub and fix typos

* Fix gallery

* Fix typo

* Address comments + tests

* Update gradio/themes/app.py

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

* Import Base as Theme. Use DefaultTheme() as fallback

* Fix types

* Make version and token truly optional

* Add version dropdown + tests

* trigger

* Support private themes and org_names

* Fix org_name typo

* Update wheel

* Fix font loading and dumping

* fixing tests

* fix tests

* formatting

* version

* remove requirements

* remove requirements

* formatting

* fix tests

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 20:15:02 -07:00
aliabid94
8114202697
Use soft theme instead of glass theme in demo (#3503)
* changes

* changes

* changes

* changes

* changes

* Update gradio/themes/base.py

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

* Update gradio/themes/base.py

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* Update guides/03_building-with-blocks/06_theming-guide

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

* changes

* changes

* changes

* changes

* changes

* undo merge break

* changes

* changes

* changes

* fix

* theme_to_soft

* changes

* formatting

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 13:07:23 -07:00
space-nuko
52253b8bb1
Remove IOComponent.add_interactive_to_config (#3476)
* Remove `IOComponent.add_interactive_to_config`

* Move interactive mode conversion into postprocess

* Requested changes

* Update tests

* Fix test

* Fix test

* Fix test

* Fix test

* updating test file

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:13:19 -07:00
gitgithan
ee1a76fd10
fix #3282 avoid in-place dict updates (#3405)
* fix #3282 avoid in-place dict updates

* add tests and changelog for PR3405
2023-03-07 10:12:19 -08:00
Freddy Boulton
47d6231680
Always set queue=False if every is None for load events (#3391)
* Always set queue=False if every is None

* CHANGELOG + linting

* Move to latest release section

* changelog

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-06 18:27:04 -07:00
Freddy Boulton
53e4733f2a
Add types field to dependency config (#3315)
* Add to config

* CHANGELOG

* Safe pop

* Fix test
2023-02-24 20:07:31 -05:00
Abubakar Abid
74d9080fcd
Miscellaneous warnings and errors (#3194)
* changes

* added workflow

* fix action

* fix action

* fix action

* warning for filetypes

* miscellaneous warnings and errors

* Delete benchmark-queue.yml

* Delete benchmark_queue.py

* changelog

* warning

* formatting

* changelog

* formatting
2023-02-14 16:21:09 -06:00
Freddy Boulton
c06b4eab16
Bar Plot Component (#3157)
* Add code - first draft

* Getting better

* Work out the bugs

* Fix docstrings

* CHANGELOG

* Fix test

* Generate notebooks

* Add unit test

* Undo website package.lock

* Fix demo

* Fix notebooks

* Fix docstrings

* Improve example in CHANGELOG

* Address comments + feedback

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-02-09 16:42:25 -05:00
Freddy Boulton
9beb15b3ec
Turn Submit Button into Cancel Button for Interfaces with generators (#3124)
* Switch back from stop button

* Add unit test

* CHANGELOG

* Fix test

* lint

* Reset UI after exception
2023-02-06 14:30:21 -05:00
Freddy Boulton
9b15e9a1f8
Update docs to explain how reload mode can be used with queue/auth (#3089)
* Add note to guide

* Add more explanation

* Undo changes

* CHANGELOG

* Make work with queue + fix docs

* Changelog fix

* Add unit test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-02-02 15:39:45 -05:00
Freddy Boulton
9ccfef0542
Fix auth on spaces (#3049)
* Add route alias

* on button click

* Fix config

* Do not redirect

* Use login to check if other route necessary

* Add message about HF spaces

* CHANGELOG

* Add gif to changelog
2023-01-30 11:11:32 -05:00
Freddy Boulton
eac49196a7
Properly Restart Queue After App is Closed (#3022)
* Debug code

* Fix bug + add test

* CHANGELOG

* Update test

* Revert change

* Use 1 second sleep

Co-authored-by: aliabid94 <aabid94@gmail.com>
2023-01-24 10:52:09 -05:00
Anton Lozhkov
981cd1ea68
Fix the path check for long CSS strings in Blocks (#2953)
* Fix the path check for long CSS strings in Blocks

* Add a test

* Update changelog
2023-01-08 06:31:21 -05:00
aliabid94
58b1a074ba
Add Progress Bar component (#2750)
* changes

* version

* changes

* fixes

* changes

* changes

* changes

* changes

* chagnes

* chagnes

* fix

* changes

* changes

* changes

* change

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* version update

* Commit from GitHub Actions (Upload Python Package)

* changes

* changes

* changes

* fix

* changes

* changes

* changes

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* changes

* changes

* changes

* changes

* change

* changes

* Update guides/01_getting_started/02_key_features.md

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

* Update gradio/helpers.py

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

* Update gradio/routes.py

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

* Update gradio/helpers.py

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

* Update guides/01_getting_started/02_key_features.md

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

* Update guides/01_getting_started/02_key_features.md

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

* Update demo/progress_simple/run.py

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

* Update demo/progress_simple/run.py

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

* Update demo/progress_simple/run.py

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

* Update website/homepage/src/docs/template.html

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

* Update website/homepage/src/docs/template.html

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

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* changes

* changes

* changes

* change

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: GH ACTIONS <aliabid94@users.noreply.github.com>
2022-12-30 11:45:54 -08:00
Abubakar Abid
de0c41c1c4
Enforcing typing in blocks.py and context.py (#2887)
* started pathlib

* blocks.py

* more changes

* fixes

* typing

* formatting

* typing

* renaming files

* changelog

* script

* changelog

* lint

* routes

* renamed

* state

* formatting

* state

* type check script

* remove strictness

* switched to pyright

* switched to pyright

* fixed flaky tests

* fixed test xray

* fixed load test

* fixed blocks tests

* formatting

* fixed components test

* uncomment tests

* fixed interpretation tests

* formatting

* last tests hopefully

* argh lint

* component

* fixed based on review

* refactor
2022-12-27 16:54:47 -05:00
Freddy Boulton
1765cf68ae
Make it so that default_enabled has no impact on queue behavior (#2876)
* Deprecate default_enabled + test

* CHANGELOG

* Remove docstring for deprecated param

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

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-12-21 16:11:20 -05:00
Freddy Boulton
96297c0bad
LinePlot (#2807)
* First draft

* Fix tests

* Fix pdb

* Figure out stroke dash + legend position

* Add legend position

* Add back gif

* Add demo + update demo

* Format notebooks

* Changelog

* More changelog

* Undo notebooks

* Reword

* Set lower bound for altair

* Modify docstrings

* Add LinePlot image to changelog
2022-12-20 11:13:51 -05:00
Abubakar Abid
4e7317036d
Adds an every parameter to every component (#2806)
* bigquery draft

* updated guide

* orjson fix

* formatting

* changelog

* attach every

* removed queue=False

* added test

* formatting

* adding event

* wip

* fix implementation

* remove prints

* formatting

* lint

* formatting

* reset guide

* changelog

* fix tests

* added test

* changelog

* renamed

* renamed

* lint
2022-12-15 16:07:44 -06:00
Abubakar Abid
20057aa946
Create fewer temp files and make them consistently-named (#2758)
* tmp files

* components

* changes

* temp_file_sets

* TempFileManager class

* added file manager

* internal functions

* tests

* formatting

* changes

* video tests

* added tests for File

* cheetah image

* formatting

* tests for upload button

* temp files

* formatting

* changelog

* fixed audio

* tmp files

* tmp files

* gallery

* deprecated type=file

* fixing tests

* patch os.path.exists

* fixed test_video_postprocess_converts_to_playable_format

* fixed tests

* changelog

* fix tests

* formatting

* added a download_if_needed

* formatting

* fixed download

* fixed gallery demo

* fix tests

* version

* fix for mac

* consolidate
2022-12-15 14:37:09 -06:00
Dawood Khan
714ab2cc09
Audio waveform (#2706)
* utils func

* changes

* changes

* changes

* notebook

* fix

* changes

* change

* changes

* changes

* notebook fix

* changes

* changes

* changes

* change

* fix

* revert backend changes,  gr.make_waveform

* notebook

* Update CHANGELOG.md

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

* format fix

* changes

* changes

* revert pnpm

* change

* change

* changes

* changes

* changes

Co-authored-by: Ali Abid <aabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-12-15 12:35:22 -06:00
Freddy Boulton
3672e17256
Terminate generating events early if the session is closed (#2783)
* Return early if no awake events

* Add to changelog

* Add test

* Clarify when events are cancelled in the docs
2022-12-12 09:15:50 -05:00