Commit Graph

61 Commits

Author SHA1 Message Date
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
Freddy Boulton
71f1e654ab
Fix bug where functions with type hints caused errors (#4068)
* Fix + test

* CHANGELOG

* Update test/test_utils.py

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

* Update gradio/utils.py

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

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-05-04 21:38:41 -05:00
Abubakar Abid
2be3ea1cc7
Sets matplotlib backend to agg before rendering math (#4029)
* matplotlib-agg

* fix

* context manager

* Update CHANGELOG.md

* update demos

* linting

* removed warning

* fix test

* fixes

* fix tests
2023-05-01 23:59:31 -05:00
Micky Brunetti
5e9c3b0ac8
Fix HTTP code for file request (static, assets, file) (#3895)
* Fix HTTP code for file request (static, assets, file)

* Fix bugs related to utils.abspath for symlink and unresolvale path

* Requesting a directory from the file route now returns 403
2023-04-20 15:18:33 -04:00
January Desk
e0eea96766
Fix false positive warning in check_function_inputs_match (#3837)
* fix false positive warning of check_function_inputs_match

* apply linter

* Update CHANGELOG and add comments in test

* Lint

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-19 15:44:28 -04:00
Abubakar Abid
6e6121a1ac
Sets up the Python gradio client (#3300)
* placeholder

* changelog

* added to readme

* client

* implement futures

* utils

* scripts

* lint

* reorg

* scripts

* serialization

* cleanup

* fns

* serialize

* cache

* callbacks

* updates

* formatting

* packaging

* requirements

* remove changelog

* client

* access token

* formatting

* deprecate

* format backend

* client replace

* updates

* moving from utils

* remove code duplication

* rm duplicates

* simplify

* galleryserializer

* serializable

* load serializers

* fixing errors

* errors

* typing

* tests

* changelog

* lint

* fix lint

* fixing files

* formatting

* type

* fix type checking

* changelog

* changelog

* Update client/python/gradio_client/client.py

Co-authored-by: Lucain <lucainp@gmail.com>

* formatting, tests

* formatting, tests

* gr.load

* refactoring

* refactoring'

* formatting

* formatting

* tests

* tests

* fix tests

* cleanup

* added tests

* adding scripts

* formatting

* address review comments

* readme

* serialize info

* remove from changelog

* version 0.0.2 released

* lint

* type fix

* check

* type issues

* hf_token

* update hf token

* telemetry

* docs, circle dependency

* hf token

* formatting

* updates

* sort

* script

* external

* docs

* formatting

* fixes

* scripts

* requirements

* fix tests

* context

* changes

* formatting

* fixes

* format fix

---------

Co-authored-by: Lucain <lucainp@gmail.com>
2023-03-23 15:33:44 -07:00
aliabid94
608d3b6250
Python backend to theming (#2931)
* add theme + theme atoms

* audio

* buttons

* chatbot

* forms

* start file

* complete file

* fixup workbench

* gallery

* highlighted text

* label

* json

* upload

* 3d model

* atoms

* chart

* md + html

* image

* plot + build

* table

* tabs

* tooltip

* upload

* tweaks

* tweaks + more tooling

* tweaks to padding/ lineheight

* app components _ start api docs

* format, more api docs

* finish api docs

* interpretation

* todos

* tweaks + cleanup

* tweaks + cleanup

* revert range tweaks

* fix notebooks

* fix test

* remove tw

* cleanup + login

* fix gitignore

* fix types

* run css script

* fix progress + tweaks

* update demos

* add css build to static check workflow

* tweak ci

* fix tests

* tweak markdown

* tweak chatbot + file

* fix tabs

* tweak tabs

* cleanup

* fix api docs

* fix example gallery

* add gradient to toast

* fix min height for interfaces

* revert tab changes

* update notebooks

* changes

* changes

* change

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* fix

* changes

* changes

* changes

* changes

* changes

* changes

* undo radius

* undo radius

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* undo

* Add absolute imports

* mock theme in tests

* clean

* changes

* changes

---------

Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-06 12:52:31 -08:00
Abubakar Abid
d3371ec7d3
Fixes gr.utils.delete_none (#3188)
* changes

* added workflow

* fix action

* fix action

* fix action

* fixed delete none

* Delete benchmark-queue.yml

* Delete benchmark_queue.py

* changelog

* fixing tests

* format
2023-02-13 15:28:43 -06:00
Abubakar Abid
85e8f3070c
Sagemaker check (#3137)
* kaggle check

* add tests

* sagemaker

* changelog

* type check

* update test requirements
2023-02-07 08:25:24 -08:00
Freddy Boulton
42ad0cbe45
Enable gradio to work on kaggle (#3101)
* enable share kaggle

* Add test

* CHANGELOG

* Add image to changelog
2023-02-01 11:53:53 -05:00
Abubakar Abid
df3a50b3cc
Running requests in background (#3054)
* formatting

* revert dmeo

* changelog

* fix tests
2023-01-25 18:01:39 +05:00
Abubakar Abid
862a8c7c71
Added symlink support (#3037)
* added symlink support

* changelog

* lint

* fix tests

* tests
2023-01-20 19:52:42 -08:00
Abubakar Abid
5182460886
Patching test_get_ip attempt 2 (#2810)
* ip-patch-2

* formatting

* patch 2
2022-12-13 20:30:47 -06:00
Abubakar Abid
b492212c02
Patch ip test (#2808)
* patch ip test

* changelog
2022-12-13 17:15:14 -06:00
SkyTNT
2c04f77281
Fix filename too long in processing_utils.decode_base64_to_file and processing_utils.create_tmp_copy_of_file (#2685)
* fix filename too long

* move to strip_invalid_filename_characters

* test

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-11-27 20:55:10 -06:00
Abubakar Abid
5e148c3752
Adding ability to access in Fastapi request object into your function (#2641)
* fastapi requests

* formatting

* implement

* fix

* formatting

* formatting

* changelog

* added demo

* remove print

* added to guide

* changes for queuing

* changes to gr.Request

* formatting

* formatting

* fixes

* lint

* fixed tests

* fix batching

* fixing tests

* cleanup

* lint

* added tests; fixed review

* improve docs
2022-11-19 00:52:06 -08:00
Abubakar Abid
8ec0a1e2b8
Quick fix to gr.utils.validate_url (#2659)
* fix validate

* formatting

* fix tests

* added flaky mark
2022-11-16 12:21:51 -08:00
Abubakar Abid
010827e211
Refactoring to replace unittests with pytests (#2610)
* replace pytests with unittests

* formatting

* test blocks

* fixed test/blocks

* test components

* working on test components

* test components

* test components almost fixed

* removed unittest

* linting

* fix remaining tests

* lint

* formatting

* changelog
2022-11-08 01:37:55 +01:00
Abubakar Abid
6c33eed976
Promotes postprocess and preprocess to documented parameters (#2293)
* changes

* Delete media_data.py.isorted

* fixes in other files

* fixes in other files

* added for grid

* removed status tracker

* removed status tracker

* added deprecation warning

* formatting
2022-09-19 19:38:17 -05:00
Abubakar Abid
7bda7eedd1
Fixed Named API Requests (#2151)
* fixed duplicate api_name issue

* fixed name

* formatting

* fixed errors

* more complex test

* formatting
2022-09-02 04:10:20 -07:00
Abubakar Abid
4e1ee4099f
3.2 release! (#2139)
* 3.2

* ip address test catch

* treat 3.x interfaces as interfaces

* formatting

* mode
2022-08-31 13:49:06 -07:00
Abubakar Abid
4a1321ce8a
Updated our analytics on creation of Blocks/Interface (#2082)
* added version to analytics

* formatting

* fix flake

* disabled analytics on anything that runs via ci/cd

* formatting
2022-08-25 13:23:28 -07:00
Abubakar Abid
88e9c19c27
Cleaning up the way data is processed for components (#1967)
* remove preprocess_example

* removing methods

* added path support for images

* fixes

* video

* formatting

* fixing preprocess

* fixes

* removed from audio

* fixed file

* formatting

* serialization

* foramtting

* formatting

* removed save flag / restore flag

* formatting

* removed flagging

* removed

* load value

* fixing typing

* fixes, typing

* fixes

* file

* handling images

* formatting

* fixed serializing for flagging

* formatting

* json

* temp file

* removed processing

* changed processing

* fixed temp FINALLY

* flagging works

* fix examples test

* formatting

* async examples

* working on mix

* comment out failing test

* fixed interface problem

* fix kitchen sink deprecation warning

* gallery examples

* fixes

* fixes to serialization

* fixing label serializing

* fixed file serialization

* kitchen sink restored

* outbreak forecast updated

* formatting

* formatting and api mode

* fix 1 test :/

* fixing tests

* fixed components tests

* remvoed test files

* formatting

* fixed examples

* fixes

* formatting

* restored certain files

* added encryption

* fixed syntax mistake

* formatting

* fixed 1 test

* clean up interface

* formatting

* fixed route tests

* more fixes

* formatting

* formatting

* fixing pipeline

* format frontend

* format backend

* tweaks

* fix

* fix final test?

* merged

* Sanitize for CSV (#2017)

* sanitize for csv

* added sanitization logic

* fixed examples

* turn cache off

* fixed example caching with optional inputs

* fixed review problems

* fixed Interface.load

* updating the tests

* updating the tests

* fix

* fixed seriailizing

* testing

* rewrite run prediction

* formatting

* await

* fixes

* formatting

* finally fixed mix

* fixed tests

* formatting

* formatting

* deserialize fix

* formatting

* fixes

* fixes

* fix

* fix tests

* fixes

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2022-08-23 08:31:04 -07:00
aliabid94
b1dfc9a172
Release new queue beta (#1969)
* queue-refactor-backend (#1489)

* queue-refactor-backend

- create a template for the new design

* queue-refactor-backend

- clean after the old queue

* queue-refactor-backend

- add basic test to websocket endpoint

* queue-refactor-backend

- small fix

* queue-refactor-backend

- debugs&fixes&finalizations
- test the flow with postman

* queue-refactor-backend

- tweaks on websocket closing

* queue-refactor-backend

- cleanup

* queue-refactor-backend

- cleanup & tweaks

* queue-refactor-backend

- cleanup & tweaks

* queue-refactor-backend

- cleanup & tweaks
- correct the exception handling

* queue-refactor-backend

- add websockets dependency

* queue-refactor-backend
- reformat

* queue-refactor-backend
- add single event test

* queue-refactor-backend
- tweaks
- remove outdated tests

* queue-refactor-backend
- reformat

* queue-refactor-backend
- reformat

* queue-refactor-backend
- reformat

* queue-refactor-backend
- add Queue configurations to Blocks.launch()
- add live_queue_update to send estimations whenever a job gets fetched from the Queue

* queue-refactor-backend
- add Queue configurations to Blocks.launch()
- add live_queue_update to send estimations whenever a job gets fetched from the Queue

* queue-refactor-backend
- tweaks

* queue-refactor-backend
- make SLEEP_WHEN_FREE shorter

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

* Add estimation parameters to queue (#1889)

* - tweaks on Estimation

* version

* Revert "version"

This reverts commit bd1f4d7bfe.

* some fix and tweaks

* implement queue frontend (#1950)

* implement queue frontend

* fix types

* fix ws endpoint in build mode

* cleanup

* Queue tweaks (#1909)

* tweaks on estimation payload

* Queue keep ws connections open (#1910)

* 1. keep ws connections open after the event process is completed
2. do not send estimations periodically if live queue updates is open

* fix calculation

* 1. tweaks on event_queue

* fix issue - create new ws for each request

* format

* fix

* fix tests

* fix tests

* tets

* test

* changes

* changes

* changes

* change'

* wtf

* changes

* changes

* file perms

* Release queue beta v1 (#1971)

* - release the new queue

* - bypass the issue in the tests
- rewrite the lost part in the codebase

* - add concurrent queue example (#1978)

* rank_eta calc

* Queue fixes (#1981)

* change

* format

* - comment out queue tests as they dont work well

* - reformat

* Update gradio/event_queue.py

Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>

* changes

* changes

* change

* weird fix

Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>

* release-queue-v3 (#1988)

* Fix frontend queuing to target secure WSS (#1996)

* change

* format

* changes

* queue-concurrency-tweaks (#2002)

1. make gather_data and broadcast_estimation sequential instead of concurrent because they were deleting elements at the same time and raising expections which was lowering the performance

* Update Queue API, documentation (#2026)

* changes

* changes

* fixes

* changes

* change

* fix

Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
2022-08-17 11:17:56 -07:00
Freddy Boulton
74d632eab5
Add python-3.7 tests (#1818)
* Add python-3.7 tests

* Format components

* Use latest images

* Use python instead of python3

* Force reset cache

* Reset cache

* Use Ipython 7 for python 3.7 support

* Install chrome

* Add two text files

* Reset cache

* Use Literal from typing extensions

* Update cache key

* Linting

* Fix requests tests

* Exit if running from wrong python version

* Use one requirements file

* Fix comment

* Fix comment

* Use python 3.7.13

* empty commit

* Delete chrome driver to see if it works

* Test no chrome with new cache

* Remove chrome driver install entirely
2022-07-19 10:48:46 -04:00
Freddy Boulton
4731b1aaba
Mock out requests in TestRequest unit tests (#1794)
* Use mocks to not rely on external api

* Mock all requests

* Fix order of import statements
2022-07-18 10:25:12 -04:00
Abubakar Abid
44e9a4d054
Fix assert_configs_are_equivalent_besides_ids() (#1700)
* fixed importlib

* reverted pkg resources

* fixed assert

* fixed xray config

* formatting

* ignored status tracker

* assert

* added copy

* formatting

* addressed feedback

* formatting

* unnecessary copy
2022-07-05 15:19:41 -07:00
Abubakar Abid
68afe67497
test hotfix (#1705)
* test hotfix

* init
2022-07-04 15:29:19 -07:00
Halil Ibrahim Bestil
3026b8f597
Add type hint to provide autocompletion for Request class instances. (#1642) 2022-06-26 17:10:02 +03:00
Halil Ibrahim Bestil
51c8c34486
Async Request Class (#1595)
* Implement Request class and its tests.

* Add new requirements

* Reformat codebase.

* Fix formatting.

* Add library level requirements.

* Convert validated_data property to get_validated_data function.

* Fix the client fixture.

* Update test/test_utils.py

* Update test/test_utils.py

* Fix the client fixture.

* Add missing initialization for Request._validated_data

* Fix async test problem with test_tunneling.py

* Update gradio/utils.py

* Update gradio/utils.py

* Fix formatting.

Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>
2022-06-23 20:44:04 +03:00
Abubakar Abid
4bd609bcc0
A few small fixes (#1171)
* allow markdown to be set dynamically

* moved markdown to output section

* added aliases for component names

* added aliases

* fixed optional

* formatting

* tests

* tests

* tests
2022-05-06 00:29:02 -07:00
Abubakar Abid
5c34d91865
added better default labels to form components (#1040)
* added better default labels to form components

* updated default labels

* formatting

* fixed tests
2022-04-20 10:54:44 -07:00
Ali Abid
4f1947d8c7 merge in master 2022-04-18 18:36:43 -07:00
Ömer Faruk Özdemir
dc6175a21d
tabbed-interface-rewritten (#958) 2022-04-08 12:13:56 +03:00
dawoodkhan82
10bb240e23 reformat 2022-03-21 14:02:17 -04:00
Abubakar Abid
457df16d6b added full highlighting and tests 2022-03-21 10:42:53 -07:00
Ali Abid
abb85c0f9b changes 2022-03-16 19:26:39 -05:00
Abubakar Abid
2a7757ee7e formatting
Former-commit-id: b78188d885230fd4ad617ee7288e840aa6dea321
2022-03-14 09:37:30 -05:00
Abubakar Abid
a415e5abc8 sanitize flagging inputs before writing to csv
Former-commit-id: f2d9f808c79abec7f2c8ff4a94b17a9b1cdd5651
2022-03-14 09:36:51 -05:00
Ömer Faruk Özdemir
4c5e116709 Format-The-Codebase
- add a format script
- solve a conflict between flake8 and black
2022-02-10 11:12:26 +03:00
Ömer Faruk Özdemir
972c66e09b Format-The-Codebase
- solve the flake8 warnings
2022-02-09 22:52:26 +03:00
Ömer Faruk Özdemir
82cb2de626 Accelerate Tests
- add coverage to the circleci
- combine the divided tests into single folder
- update requirements
2022-02-09 08:50:00 +03:00
Ömer Faruk Özdemir
bb6805e25f Accelerate Tests
- Create local and cloud test folders and move all the tests with duration > 1 second to the cloud tests.
- Update scripts
2022-02-07 14:29:55 +03:00
Ömer Faruk Özdemir
cc0cff893f Format The Codebase
- black formatting
- isort formatting
2022-01-21 16:44:12 +03:00
Abubakar Abid
018123e9b7 added more detail on error analytics 2022-01-11 15:28:03 -06:00
Abubakar Abid
86c6a61b55 fixed tests 2022-01-07 10:25:41 -06:00
Abubakar Abid
c3cb06a17c fixed tests 2022-01-04 12:58:37 -05:00
Abubakar Abid
118315fe4b fixed tests; had to remove one from utils 2021-12-21 13:40:22 -06:00
Abubakar Abid
8dc11093b9 significant cleanup and test fixes 2021-12-16 09:43:31 -06:00
Abubakar Abid
d09b24ae5f fixed tests based on Ali's feedback 2021-11-09 12:30:59 -06:00