Commit Graph

534 Commits

Author SHA1 Message Date
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
1510cb73cc
Queue error fix & custom errors (#2047)
* changes

* format

* changes

* changes

* custom error

* change

* change

* change

* changes

* change

* fe fix

* changes

* changes
2022-08-22 11:05:55 -07:00
Ömer Faruk Özdemir
f66c104fc2
Max thread tweaks (#2038)
* max-thread-tweaks

1. move creation of limiter to fastapi endpoint since run_coro_in_background works only in there
2. make max_threads compatible with queue concurrency count

* max-thread-tweaks

1. add warning to run_coro_in_background
2022-08-19 16:28:52 -04:00
aliabid94
029637cef9
Queue maximum length (#2036)
* changes

* format

* changes

* changes
2022-08-18 18:29:51 -04:00
Dawood Khan
13915f9c11
[Integration Tests] Update a demo's config.json as part of integration test (#2005)
* add script to create configs for test demos

* no message

* fixes

* fixes

* fix

* test fix

* test fix

* format

* fix
2022-08-17 15:43:26 -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
Freddy Boulton
8e24d5d646
Deploy All Demos to Spaces on PRs (#2012)
* Add step to deploy to spaces on release

* Import package not modules

* Lint

* Hacky solution

* Add app file

* Github actions script

* Fix bucket url

* Update versioning

* Fic typo in script

* Change path

* Fix quote

* Clean up action

* Fix keys

* Formatting + comment

* Fix all_demo creation

* lint ui

* Get latest pypi version and use only 20 demos

* Test version change works correctly

* Fix gradio version

* Fix typo

* Use github sha to rebuild on every commit

* Get sha the proper way

* Change where env is accessed

* Fix typo in cp

* Undo changes to version.txt

* Add matrix transpose
2022-08-16 12:07:20 -04:00
Freddy Boulton
21f9da9380
Automatically deploy kitchen sink to spaces on release (#1994)
* Add step to deploy to spaces on release

* Import package not modules

* Lint

* Add comment on slack
2022-08-12 11:51:36 -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
0cdb9b564c
Fix screenshot gif (#1966)
* fix screenshot

* fix gif
2022-08-08 09:52:21 -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
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
pngwn
3a58dd1924
default to a single table row (#1936) 2022-08-02 22:02:49 -07:00
Freddy Boulton
db1ff439a7
Fix docs (#1908)
* Fix docs

* Fix ner demo

* refactoring script templates

* remove linksnav in guides

Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2022-07-29 16:21:05 -04:00
Ali Abid
0e4931fbe2 changes 2022-07-26 15:11:08 -04:00
Abubakar Abid
0019c12844
added multistep to docs (#1880) 2022-07-25 17:00:13 -07:00
Martina Fumanelli
ba65a95e07
Add new component guide (#1861)
* Add first steps to new component guide

* Add last steps to new component guide

* Fix review minors on new component guide

* Fix first steps to new component guide

* Fix last steps to new component guide

* Fix color_picker demo examples

* Add code snippets to new component guide

* Apply suggestions from code review to new component guide

Co-authored-by: pngwn <hello@pngwn.io>

* Add explanation for different types of component files in new component guide

Co-authored-by: Luigi Cerone <luigicerone96@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
2022-07-25 16:25:50 -04: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
Dawood Khan
cd0d520696
Plot Component Integration Test (#1859)
* plot integration tests

* format

* remove files
2022-07-25 12:48:59 -04:00
Ali Abid
21f80d77df changes 2022-07-25 08:45:13 +01:00
Ali Abid
7a486d77f6 changes 2022-07-25 04:46:11 +01:00
Ali Abid
3a93202fd6 changes 2022-07-25 02:18:42 +01:00
曾逸夫(Zeng Yifu)
026e6cab55
Create run.py (#1872) 2022-07-23 17:22:54 -07:00
Dawood Khan
babbb7eb41
Add new i18n tokens (#1751)
* add new i18n tokens

* fixes

* fixes

* format
2022-07-22 21:32:55 +01:00
Abubakar Abid
c638aa9961
Improve flagging guide & add flagging with Blocks (#1853)
* improving guide

* flagging guide

* remove img

* fixed spaces

* fixes
2022-07-22 12:14:34 -07:00
Freddy Boulton
9360670e23
Add guide on how to add interpretation to a Blocks App (#1851)
* Add demo code

* Guide rough draft

* Update demo

* Add image classification demo
2022-07-22 12:00:24 -04:00
Freddy Boulton
c579aa195d
Clarify API of custom interpretation function + fix demo (#1842)
* Modify demo + guide on custom interpretation

* Fix typo

* Change interfaces to inputs
2022-07-21 09:42:49 -04:00
Abubakar Abid
493cf7c069
fix (#1837) 2022-07-20 06:39:47 -07:00
Freddy Boulton
3f9ec2c345
Add a guide on how to use apps like functions (#1799)
* Add examples for series and parallel

* Create demo + guide

* More formatting

* Change name of guide

* Fix typo

* Use english to german as example instead

* Expand phrase a bit
2022-07-19 17:43:53 -04:00
Freddy Boulton
4a1879edaf
Remove usage of deprecated gr.inputs and gr.outputs from website (#1796)
* remove deprecated api from docs

* Remove usage of 'state' shortcut

* Back out state changes

* Back out state changes in creating_a_chatbot

* Link chatbot guide to Variable docs
2022-07-19 11:53:01 -04:00
Ali Abdalla
0dbc8bfcf3
Embedding Components on Docs (#1726)
* add component code to demos docker files

* fix demo_name

* frontend

* fix demo-name in frontend

* remove built with gradio

* remove extra space

* styling

* wait till page loads

* fixing components that require more parameters

* remove print statements

* check for correct run file

* combining component demos to one file

* typo

* fixes

* suffix name

* add is_component

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-07-19 16:20:20 +01:00
Freddy Boulton
8aba1c991b
Add info to docs on how to set default values for components (#1788)
* Explicitly set value and add to docs

* Fix wording a bit

* Remove sentence that's not adding much

* Remove extra word

* Delete screenshot
2022-07-19 11:16:56 -04:00
Freddy Boulton
006347459c
Add color picker to docs (#1768) 2022-07-18 11:55:48 +03:00
Freddy Boulton
de4458361b
Add gr.update to blocks guide (#1649)
* Add gr.update to guide

* Add to docs page and add step-by-step guide

* Fix documentation tests

* PR reviews

* Use code snippet

* Make section title plural

* Blocks utils in their own section
2022-07-14 11:43:38 -04:00
pngwn
c323aac274
add example component for color picker (#1779) 2022-07-13 16:35:43 +01:00
Freddy Boulton
600722c218
Add examples for series and parallel (#1738)
* Add examples for series and parallel

* Add ML demos for interface and load
2022-07-11 11:21:30 -04:00
Freddy Boulton
54f330af48
Add examples component to docs (#1729)
* Add examples to docs

* Adding guide for examples

* Exclude guides from methods

* PR feedback: typos, different allowed values of examples, docstrings
2022-07-08 11:32:08 -04:00
pngwn
8c4e134094
allow users to update the current tab from python SDK (#1709)
* allow users to update the current tab from python SDK

* rename var

* ensure tabs work when no selected or id kwargs are passed

* update xray config

* update test

* update test again

* Apply suggestions from code review

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

* change false to None

* update test configs

* fix test

* fix test

* update global tab selection

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-07-07 15:37:51 +01:00
Abubakar Abid
c9f522e02b
Allow excluding input components in examples (#1722)
* ignore None examples

* formatting

* added demo

* fixed test
2022-07-06 21:30:51 -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
e2cebde5e6
Allows setting custom <title> (#1703)
* fix title issue

* formatting

* docstrings and demos
2022-07-05 14:21:20 -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
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
Dawood Khan
eb42fc3cf8
Kitchen Sink Integration tests (#1588)
* tests

* more tests

* more tests

* remove files
2022-07-01 01:27:47 -04:00
Dawood Khan
7030a2a6cf
Fix example image thumbnail size (#1627)
* fix example image thumbnail size

* format

* remove cache examples

* add classes to token.css

* add small image
2022-07-01 01:27:35 -04:00
pngwn
1e6ceb9543
Mask image (#1621)
* changes

* add masking to image

* added preprocessing for mask

* tweaks + improvements to masking

* make mask work with webcam input

* cleanup

* fix default image

* fix default value when source is upload

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-06-25 01:11:28 +01:00