Commit Graph

475 Commits

Author SHA1 Message Date
cobryan05
b145a2a191
Keep embedded PngInfo metadata (#2170)
* Keep embedded PngInfo metadata

Maintain any text-only PngInfo metadata on a PIL image when
dragging UI images between components.

* Minor cleanup
2022-09-04 18:54:30 -07:00
Hoàng Tùng Lâm (Linus)
66ef85b874
Fixed misleading log when server_name is '0.0.0.0' (#2176)
* Fixed misleading log when server_name is '0.0.0.0'

* some cleanups

* formatting

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-09-04 18:48:08 -07: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
Freddy Boulton
880c63e200
Better processing of example data prior to creating dataset component (#2128)
* WIP commit

* Add method to components

* Validate image filepath

* Remove unused imports

* Fix validation

* Only display name for model3D

* Remove image validation

* Don't use abstractmethod - add tests

* Remove unused import

* Remove breakpoint
2022-08-31 12:46:43 -07:00
Dawood Khan
4816e3fb12
Fix: Download button does not respect the filepath returned by the function (#2073)
* download fix

* tweaks

* formatting

* added orig filename

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-29 13:39:15 -07:00
Freddy Boulton
85229a7058
Catch IndexError, KeyError in video_is_playable (#2113) 2022-08-29 12:57:04 -04:00
Abubakar Abid
4d58ae79b3
Improvements to State (#2100)
* state

* state fix

* variable -> state

* fix

* added state tests

* formatting

* fix test

* formatting

* fix test

* added tests for bakcward compatibility

* formatting

* config fix

* additional doc

* doc fix

* formatting
2022-08-29 09:53:05 -07:00
Abubakar Abid
adf52d2dad
Label component now accepts file paths to .json files (#2083)
* added label support for file paths

* formatting
2022-08-25 15:26:27 -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
Chris Emezue
9c4dc6c183
Add a flagging callback to save json files to a hugging face dataset (#1821)
* work on saving flags in JSON format

* explained what I did more clearly

* final updates + added test case

* reviews to flagging.py for HuggingFaceDatasetJSONSaver

* formatted imports

* used uuid for random ids

* used uuid for random + function to get dataset infos

* reformmated flagging.py

* fix examples test

* formatting

* async examples

* working on mix

* comment out failing test

* fixed interface problem

* final updates to HuggingFaceDatasetJSONSaver flagging.py

* final updates to HuggingFaceDatasetJSONSaver flagging.py

* formatting

* some tweaks

* tweaks

* tweaks

* omar's fixes

* added back test.init

* restored test init

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-23 16:01:37 -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
Freddy Boulton
e2dc87aa2b
Reset components to original state by setting value to None (#2044)
* Fix + test

* Fix test

* Rename demo file

* Delete unused demo

* Refactor into independent demos

* change (#2059)

* Remove chatbot

Co-authored-by: aliabid94 <aabid94@gmail.com>
2022-08-22 16:04:59 -04: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
75b51808e2
Convert video to playable format if ffmpeg installed (#2003)
* Add implementation + tests

* Add comments'

* Add warning

* Update docs

* Refactor logic

* 3.7 fix attempt

* Fix 3.7 take 2

* Return original video if the conversion fails

* Use ffmprobe + restrict scope of exception

* Fix for windows

* Fix tests
2022-08-16 13:21:13 -04:00
Abubakar Abid
a424832ec1
Fix async tests (#2000)
* fix examples test

* formatting

* async examples

* working on mix

* comment out failing test

* fixed interface problem

* fixes
2022-08-11 12:08:06 -07:00
Ömer Faruk Özdemir
4e218fe00f
async-interface-fix (#1845)
* async-interface-fix

- support async in interface with workarounds
- make mix.Parallel async and concurrent

* async-interface-fix

- fix & tweaks

* fix interpretation

* async-interface-fix

- fix mix

* async-interface-fix

- fix tests
- tweaks

* async-interface-fix

- take TODO notes on interface related to refactoring

* async-interface-fix

- fix test_mix

* async-interface-fix

- test create_app

* fix series

* fix series

* reformat

* fix interface test

* - fix tests by moving them async

* - bypass the test

* - bypass the test

* - bypass the test

* - bypass the test without closing it

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-10 18:29:14 -04:00
Freddy Boulton
393c1f47d5
Fix invalid wav file error when converting from microphone to file (#1987)
* ;q
:wq

* Add demo

* Add unit test

* Fix test

* Slight refactor

* Lint

* Delete some recordings - import module not method
2022-08-09 16:40:31 -04:00
Freddy Boulton
d7c1a9eec4
Prevent Dataframe post-processing from changing dtypes (#1979)
* Fix datetime logic python

* Fix docstring

* Add demo

* Update test
2022-08-08 21:28:07 -04:00
Abubakar Abid
5fe02164f9
Fixes to gr.Examples (#1952)
* still working

* remove exampleset logic

* wip

* added tests and fix

* fixed header issue

* more tests

* formatting

* removed print

* Update gradio/examples.py

* used context managers

* more readable

* removed unnecessary start index

* formatting
2022-08-08 10:35:26 -07:00
Freddy Boulton
1fcff2d710
Allow Users to set random value on sliders on app load (#1935)
* Allow value=random for slider

* Commit all files

* Remove commented out breakpoint

* Remove unused imports

* Always bypass queue

* Lint

* Add randomize parameter

* Update docstring

* Add load_fn logic

* Add new random logic

* Add kitchen sink random

* Add random kitchen sink

* Fix tests + lint

* Add test all components accept load_fn

* Update docstring

* Address final comments

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-05 18:51:03 -04:00
Abubakar Abid
f46e95d7e0
Fixes to TabbedInterface (#1951)
* tabbed

* formatting

* fixed test

* fixed based on review
2022-08-04 18:46:15 -07:00
Freddy Boulton
299ba1bd1a
Fix bug where you cannot cache examples with Interface.load (#1949)
* Possible fix

* Remove breakpoint

* Implementation

* Add unit test

* Fix test

* Lint

* Add _api_mode to interface signature
2022-08-04 20:20:44 -04:00
Freddy Boulton
c316cda746
Enable flagging/caching examples for Gallery (#1938)
* Cache examples for gallery

* Add unit test

* Store all gallery samples under the same sub directory
2022-08-03 17:38:01 -04:00
pngwn
3a58dd1924
default to a single table row (#1936) 2022-08-02 22:02:49 -07:00
aliabid94
16826ee9cc
Fix broken API page (#1919)
* chagnes

* frontend_fix

* changes

* changes

* changes

* changes

* changes

* fixed typing

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-01 18:15:55 -07:00
pngwn
5d03174e44
Always return headers from postprocess (#1893)
* always return data/headers from dataframe postprocess

* add demo back

* handle case of no new headers but different length list

* fix tests

* change

* change

* added unit tests

* formatting

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-08-01 15:57:31 -07:00
Abubakar Abid
c9b8ad80fd
NER Improvements and Guide (#1869)
* ner accept hf format

* formatting

* added ner guide

* guide fixes

* added unittests for highlighttext

* formatting
2022-07-25 12:16:00 -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
Abubakar Abid
4149d00822
integrate() method moved to Blocks (#1776)
* integrating blocks

* formatting

* added tests

* tests

* formatting

* added integrate() to docs

* typing

* typing
2022-07-18 22:47:40 -07: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
Freddy Boulton
4f6d2bd46f
Raise warning when using gr.inputs or gr.outputs (#1790)
* Remove deprecation warnings + add test

* Simplify test

* Fix broken test
2022-07-14 10:28:47 -04:00
pngwn
a18c7ddf04
allow data frame to change number of columns (#1716)
* allow data frame to change number of columns

* allow data frame to change number of columns

* fix types

* fix tests

* handle case when headers are not present

* fix tests

* fix tests finally

* reinstate demo

* address review comments

* tweak test for fix
2022-07-12 11:35:20 +01:00
Freddy Boulton
9918a9540b
Mark tests as flaky and run in separate job (#1735)
* Mark tests as flaky and run in separate job

* Fix typo

* Fix typo

* Add test type to config

* Add quotes

* Rename job to test

* Rename job to test
2022-07-11 13:20:11 -04:00
Abubakar Abid
2a67fe6ec9
remove tensorflow (#1730) 2022-07-11 15:29:55 +01:00
Abubakar Abid
06bfb6b218
Updated atomicwrites version (#1742)
* commented out test

* updated atomicwrites

* undo commenting out
2022-07-08 18:11:29 -05:00
aliabid94
70ebf698fa
Live website changes (#1578)
* fix audio output cache (#804)

* fix audio output cache

* changes

* version update

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

* Website Tracker Slackbot (#797)

* added commands to reload script

* catch errors with git pull

* read new webhook from os variable

* correcting bash

* bash fixes

* formatting

* more robust error checking

* only sends success if git changes

* catching error from script

* escaping error text to send with curl

* correct text escaping for error message

* fix search bug in guides (#809)

* Update getting_started.md (#808)

* Fix type of server returned by `Launchable` (#810)

* `Launchable` returns a FastAPI now

* Update .gitignore

* Add a missing line to getting started (#816)



Former-commit-id: 81e271ca22 [formerly 96f203108b]
Former-commit-id: eaff13262853078e0c6c0baa54c731d9e56bc73f

* Add a missing line to getting started (#816)



Former-commit-id: 81e271ca22 [formerly 81e271ca22 [formerly 96f203108b]]
Former-commit-id: eaff13262853078e0c6c0baa54c731d9e56bc73f
Former-commit-id: b5112c3f42

* Add a missing line to getting started (#816)



Former-commit-id: 81e271ca22 [formerly 81e271ca22 [formerly 81e271ca22 [formerly 96f203108b]]]
Former-commit-id: eaff13262853078e0c6c0baa54c731d9e56bc73f
Former-commit-id: b5112c3f42
Former-commit-id: bce6f9c4c5

* Add a missing line to getting started (#816)



Former-commit-id: 81e271ca22 [formerly 81e271ca22 [formerly 81e271ca22 [formerly 81e271ca22 [formerly 96f203108b]]]]
Former-commit-id: eaff13262853078e0c6c0baa54c731d9e56bc73f
Former-commit-id: b5112c3f42
Former-commit-id: bce6f9c4c5
Former-commit-id: feba0888e3

* Add a missing line to getting started (#816)

* Clean-History
- Remove 51MB file with this commit


Former-commit-id: 34b6a2325d613eeef622410f2d1ff3d869d3133c

* Clean-History
- Remove 51MB file with this commit


Former-commit-id: 34b6a2325d613eeef622410f2d1ff3d869d3133c
Former-commit-id: dd700c33cc

* Clean-History
- Remove 51MB file with this commit


Former-commit-id: 34b6a2325d613eeef622410f2d1ff3d869d3133c
Former-commit-id: dd700c33cc
Former-commit-id: 0d80e6a056

* Clean-History
- Remove 51MB file with this commit


Former-commit-id: 34b6a2325d613eeef622410f2d1ff3d869d3133c
Former-commit-id: dd700c33cc
Former-commit-id: 0d80e6a056
Former-commit-id: 20523b0519

* changes

* changes

* Homepage: header image size (#1347)

* image size

* image in local assets

* add dall-e mini banner

* undo ui changes

* changes

* changes

* updates

* updates

* changes

* changes

* changes

* h11 dependency

* add npm build-mac

* expand demo button to all classes

* add demos to docstrings

* add anchor tags to headers

* add required tag to param table

* add consistent styling for headers

* skip param beginning with underscore from docs

* skip kwargs param from docs

* remove types in param docstring

* override signature to reflect usage

* add supported events

* add step-by-step guides

* fix guide contribution link

* add related spaces

* fix img styling on guides

* pin quickstart, advanced, and block guides to top

* margin fix

* autogenerated copy buttons for all codeblocks

* changes

* documentaiton

* format

* launch

* formatting

* style changes

* remove backticks

* changes

* changes

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Co-authored-by: Ömer Faruk Özdemir <farukozderim@gmail.com>
Co-authored-by: Ali <ali.abid@huggingface.co>
Co-authored-by: Victor Muštar <victor.mustar@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-07-06 16:22:10 -07:00
Abubakar Abid
a1c391668a
Exposing examples as a component for Blocks (#1639)
* examples as component

* renamed examples

* simplify internal logic

* fix tests

* cleanup

* fixed parallel and series

* cleaning up examples

* examples

* formatting

* fixes

* added unique ids

* added demo

* formatting

* fixed test_examples

* fixed test_interfaces

* fixed tests

* removed test from now

* raise ValueError for bad parameter values

* fixing series

* fixed series

* formatting

* speed up by preprocessing examples

* fixed parameter validation logic
2022-07-06 11:23:35 -07: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
pngwn
92889b7b93
1220 mirror webcam (#1686)
* support webcam mirroring for images

* flip video in preprocessor

* finalise webcam mirroring

* address review comments

* fix formatting

* improve video UI

* fix tests

* fix tests again
2022-07-05 17:30:02 +01:00
Luigi Cerone
8f89270f50
Color picker (#1695)
* Add new colorpicker component skeleton

* Updated colorpicker skeleton with some functionalities

* - Fix default input color

- Change input style

* Add colorpicker demo

* Add tests and code format

Co-authored-by: mfumanelli <fumanellimartina@gmail.com>
2022-07-05 08:50:17 +03:00
Abubakar Abid
68afe67497
test hotfix (#1705)
* test hotfix

* init
2022-07-04 15:29:19 -07:00
Ömer Faruk Özdemir
e5fd0edce1
fix tunneling test (#1694)
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-07-04 17:04:44 +03:00
pngwn
609de11ce8
add markdown and html support to dataframe (#1684)
* add markdown and html support to dataframe

* fix bug, address review comments

* fix test

* fix test

* rename parser instance variable
2022-07-04 10:27:48 +01:00
Abubakar Abid
00a1894bf5
fixed load from spaces + added test (#1636)
* fixed load from spaces + added test

* formatting

* removed print
2022-07-01 20:21:54 -07:00
pngwn
a2b84199d8
detect all types of null default value (#1685)
* detect all types of null default value

* fix test

* address review comments
2022-07-01 19:23:02 +01:00
Freddy Boulton
d01da6e205
Fix postprocess in Audio (#1667) 2022-06-30 09:46:50 -04:00
Freddy Boulton
8c9a9a9696
Fix interpretations (#1655)
* add postprocess method on component

* Add test

* Change input in external.

* Revert accidental change
2022-06-29 18:24:27 -04: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