Commit Graph

850 Commits

Author SHA1 Message Date
Abubakar Abid
7e8c829aad
Add .input() events to gr.Audio and gr.Image (#8836)
* add input

* format

* add changeset

* add changeset

* add audio browser tests

* add browser tests

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-18 23:17:13 -07:00
Abubakar Abid
4030f28af6
Allows updating the dataset of a gr.Examples (#8745)
* helpers

* add changeset

* changes

* add changeset

* changes

* tweak

* format

* example to docs

* add changeset

* fixes

* add tuple

* add changeset

* print

* format

* clean'

* clean

* format

* format backend

* fix backend tests

* format

* notebooks

* comment

* delete demo

* add changeset

* docstring

* docstring

* changes

* add changeset

* components

* changes

* changes

* format

* add test

* fix python test

* use deep_equal

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-15 09:19:52 -07:00
Ali Abdalla
13f4cf899f
fixed (#8770) 2024-07-12 23:56:25 +00:00
pngwn
26cdd0ffe0
Revert chatbot styling (#8758)
* fix

* fix

* add changeset

* add changeset

* tests

* Fix button panel (#8762)

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-07-12 18:35:08 +01:00
Freddy Boulton
5e36144232
Add guides for msg format and llm agents (#8750)
* Add guides

* add changeset

* Add code

* Add code

* Add notebook

* rename msg_format to type

* Fix docs

* notebooks

* missing link

* Update guides

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-07-12 11:53:28 +00:00
aliabid94
1500b89e13
Allow app to fill width (#8651)
* changes

* add changeset

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-11 12:53:36 -07:00
aliabid94
e3c7079e38
gr.DateTime component (#8713)
* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* Update gradio/components/datetime.py

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

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-07-10 20:55:45 -07:00
Freddy Boulton
4221290d84
Support Message API for chatbot and chatinterface (#8422)
* first commit

* Add code

* Tests + code

* lint

* Add code

* notebook

* add changeset

* type

* Add client test

* type

* Add code

* Chatbot type

* Add code

* test chatbot

* fix e2e test

* js tests

* Consolidate Error and Tool message. Allow Messages in postprocess

* Rename to messages

* fix tests

* notebook clean

* More tests and messages

* add changeset

* notebook

* client test

* Fix issues

* Chatbot docs

* add changeset

* Add image

* Add img tag

* Address comments

* Add code

* Revert chatinterface streaming change. Use title in metadata. Address pngwn comments

* Add code

* changelog highlight

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-10 11:08:06 +00:00
Yuichiro Tachibana (Tsuchiya)
edcd5748f6
Fix playground to display errors (#8689)
* Fix the Playground on the website to trigger run_code() and install() with debounce and to display errors

* Remove an unused function, make_full_screen()

* Format demo/hello_world/run.py

* Update notebook

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-07-05 16:37:27 +09:00
Dawood Khan
bc1d45d874
Model3D point cloud and wireframe display modes (#8687)
* display modes

* add changeset

* test fixes

* lint

* Update gradio/components/model3d.py

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

* solid

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-07-04 14:06:41 -07:00
pngwn
6cc69bc6ae
fix demo (#8696) 2024-07-03 19:39:50 +01:00
aliabid94
2943d6d688
Add Timer component (#8505)
* chagnes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* add docs

* add changeset

* remove demo

* add changeset

* add changeset

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* Update gradio/components/timer.py

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

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-06-28 16:53:44 -07:00
Freddy Boulton
c12f82a36d
Bugfix: Allow multiple files to be uploaded via multimodal textbox (#8608)
* Add code

* Add file_count parameter to MultimodalTextbox

* add changeset

* Update fresh-years-feel.md

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-26 12:14:25 -04:00
magical-l
cccf0fe208
Update run.py (#8625)
* Update run.py

fix misuse

* generate notebooks

---------

Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-06-26 10:05:32 +00:00
Freddy Boulton
9204d86ed4
Add guide on cleaning up state and file resources (#8610)
* WIP

* Add guide

* add changeset

* notebook

* No log in

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-25 11:52:35 -04:00
pngwn
530f8a0b05
chatbot component tweaks (#8594) 2024-06-24 21:41:06 +00:00
Abubakar Abid
d35c290aad
Adding more docs for using components in chatbot (#8593)
* adding more docs for components in chatbot

* add changeset

* add changeset

* add simple demo

* simple demo

* notebook

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-21 18:04:27 +00:00
pngwn
7fc7455553
support html in chatbot (#8555) 2024-06-21 09:17:25 +01:00
pngwn
900cf25256
Ensure frontend functions work when they don't return a value (#8521) 2024-06-21 09:17:10 +01:00
aliabid94
797621b81a
Improved plot rendering (#8580)
* changes

* add changeset

* add changeset

* add changeset

* changes

* changes

* restore altair

* changes

* changes

* changes

* changes

* changes

* changes

* Update twenty-jokes-argue.md

* changes

* chanegs

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-20 23:09:04 +00:00
Shruti Agarwal
2b0c1577b2
Added an optional height and overflow scrollbar for the Markdown Component (#8528)
* scrollable-markdown-changes-added

* made suggested changes

* added a new story in Storybook

* add changeset

* add changeset

* tweaks

* changes

* changes

* revert example change

* tweaks

* demo changes

* more tweaks

* formatting

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-19 14:07:21 -04:00
Dawood Khan
bb504b4949
Gradio components in gr.Chatbot() (#8131)
* chatbot components

* demoi

* add changeset

* preprocess fix

* add changeset

* Make guide for tailwind more verbose (#8152)

* Lite wheel optimization (#7855)

* Add `pull_request.branches.main` as a trigger of the `publish` workflow

* [WIP] Comment out the publish steps

* Package and upload the NPM package for debug

* Skip the copy_frontend.py hook in the Lite build

* add changeset

* [WIP] Show gradio files

* [WIP] Show gradio files

* Comment out installing the gradio and gradio_client libraries

* Restore installing gradio_client because it's used by `python js/_website/generate_jsons/generate.py` that follows

* Restore installing gradio because it's used by `python js/_website/generate_jsons/generate.py` that follows

* Add code

* Revert "[WIP] Show gradio files"

This reverts commit e15fef29bd14671576e64d94d3b844786ebe7e83.

* Build the gradio wheel with the custom lite target

* add changeset

* Revert "[WIP] Show gradio files"

This reverts commit aef053f9caad203c7e1bbfa15e9f9e536f77442a.

* Revert "Skip the copy_frontend.py hook in the Lite build"

This reverts commit ca296d0e4e169adbb6af3705561869aa8c9037b7.

* Update .github/actions/install-frontend-deps/action.yml for hatch installation

* [WIP] Fix test-functional.yml and .github/actions/install-all-deps/action.yml to call the setup actions in this branch

* Revert "[WIP] Fix test-functional.yml and .github/actions/install-all-deps/action.yml to call the setup actions in this branch"

This reverts commit 571823b4a05f7e41e0b3731d51c5bd86b2e17ddc.

* Comment-in lines in publish.yml

* Move Lite build from publish.yml to deploy-spaces.yml

* Use the build_lite option of install-all-deps instead of running the build command

* [TMP] Change the branch of action files

* Fix the hatch Lite build setting

* Return pnpm pack to deploy-space

* Revert "[TMP] Change the branch of action files"

This reverts commit fe4e1c8f210eb21ac7ee1bd4b219d35e1ae84c85.

* Remove dependencies for lite build

* [TMP] Change the branch of action files

* Revert "Remove dependencies for lite build"

This reverts commit 856a858c1f49d736bfeb056ba0ec7e9bc35af29c.

* Install packaging>=23.2

* [TMP] Show packaging version

* Fix pip install

* Fix

* Uninstall packaging once

* Use `pip install -U` instead of uninstalling the exiting version

* Revert "[TMP] Show packaging version"

This reverts commit 910b6bbde3dc8777c051bd5576813913d57959f7.

* Add `-U` flag

* Set packaging version as >=23.2

* Revert the changes on pip install

* Set packaging version as >=23.2 in requirements.txt

* Revert "Set packaging version as >=23.2"

This reverts commit 8aa77c8930815e69d7256886cad88b6da8361069.

* Fix hook name

* Revert "Set packaging version as >=23.2 in requirements.txt"

This reverts commit fbd605cbfb5d06706eacc0648a2e9d7816c9de1f.

* Revert "Revert the changes on pip install"

This reverts commit 81ff38a660635fce9cb17862a2072e4d169c3466.

* Add comments

* Revert "[TMP] Change the branch of action files"

This reverts commit 0d6aa48d75a842db9b3987212deffedb0c0ca51d.

* Revert the trigger of .github/workflows/deploy-spaces.yml

* Remove unused `node_auth_token` and `npm_token` inputs from the `install-all-deps` action

* [TMP] Trigger CI based on this PR

* Remove packging installation

* Revert "Remove packging installation"

This reverts commit 4a4f18de3a.

* Revert "[TMP] Trigger CI based on this PR"

This reverts commit 6cea830c8e.

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>

* Add ETag to `/custom_component` route to control browser caching (#8170)

* Add code

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Implement JS Client tests (#8109)

* add msw setup and initialisation tests

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Remove hatch installation in js/app/package.json which is no longer needed (#8174)

* Remove hatch installation in js/app/package.json which is no longer needed

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Update test-functional.yml - Fix vulnerability code injection (#8145)

* Update test-functional.yml

* Update test-functional.yml

* tweaks

---------

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

* rework upload to be a class method + pass client into each component (#8179)

* rework upload to be a class method + pass client into each component

* add changeset

* Update client/js/src/utils/upload_files.ts

* fix storybook

* review comments

* Apply suggestions from code review

Co-authored-by: Hannah <hannahblair@users.noreply.github.com>

* format

* ts fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>

* chore(deps): update pnpm to v9 (#8123)

* chore(deps): update pnpm to v9

* update workflow

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>

* Use workspace version for code in _website (#8189)

* workspace

* add changeset

* remove circular import from preview

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Pass Error status in /dev/reload stream (#8106)

* get error message

* Support multiple clients

* add changeset

* add changeset

* add changeset

* Display in UI

* console.error the python traceback

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Convert sse calls in client from async to sync (#8182)

* convert sse calls in client from async to sync

* add changeset

* more sync

* lint

* more sync

* fix threadpool

* fix timeouts

* reuse executor

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* run python reload only if python file changed (#8194)

* run python reload only if python file changed

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>

* fix: handling SIGINT correctly in reload.py, single entrance of block_thread in blocks.py (#8158)

* fix: handling SIGINT, single block_thread and fix popen

* Use pass

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>

* Add eventsource polyfill for Node.js and browser environments (#8118)

* add msw setup and initialisation tests

* add changeset

* add eventsource polyfill for node and browser envs

* add changeset

* add changeset

* config tweak

* types

* update eventsource usage

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

* dynamically import eventsource

* revet eventsource imports

* add node test

* lockfile

* add client test in root pkg file

* lcokfile

* remove eventsource from js/app

* add changeset

* remove ts ignore

* move eventsource polyfill to eventsource factory

* add changeset

* tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Ensure connectivity to private HF spaces with SSE protocol (#8181)

* add msw setup and initialisation tests

* add changeset

* add eventsource polyfill for node and browser envs

* add changeset

* add changeset

* config tweak

* types

* update eventsource usage

* add changeset

* add walk_and_store_blobs improvements and add tests

* add changeset

* api_info tests

* add direct space URL link tests

* fix tests

* add view_api tests

* add post_message test

* tweak

* add spaces tests

* jwt and protocol tests

* add post_data tests

* test tweaks

* dynamically import eventsource

* revet eventsource imports

* add jwt param to sse requests

* add stream test

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Support custom components in gr.load (#8200)

* Add code

* add changeset

* Update fuzzy-mirrors-scream.md

* Update fuzzy-mirrors-scream.md

* Fix tests

* Update .changeset/fuzzy-mirrors-scream.md

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

* Fix code

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Refactor analytics to not use api.gradio.app (#8180)

* Analytics refactor

* add changeset

* add changeset

* Fix wasm?

* Fix python tests'

* Revert changes chrome

* use util function

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Specify the fastapi version on Lite to avoid ujson installation which is not available on Pyodide yet (#8204)

* Specify the fastapi version on Lite to avoid ujson installation which is not available on Pyodide yet

* add changeset

* Refactoring

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Set the show_api flag on Lite (#8205)

* Set the show_api flag on Lite

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (#8052)

* Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (wip: only object-detection in this commit)

* add changeset

* Add image-classification and image-segmentation

* Add zero-shot-image-classification and zero-shot-object-detection

* Add document-question-answering

* Add feature-extraction and fill-mask

* Add question-answering and summarization

* Fix an error message

* Add text2text-generation, text-classification, and text-generation

* Add translation andtranslation_xx_to_yy

* Add zero-shot-classification

* Add postprocess_takes_inputs to control the args passed to the postprocess function of each pipeline

* Add topk option to image-classification

* format_backend

* Add audio-classification, automatic-speech-recognition, and zero-shot-audio-classification

* Add image-to-text

* Add token-classification (with JSON component as an output. Is it correct?)

* Ignore import type failure of transformers_js_py

* Add image-feature-extraction

* Add image-to-image

* Add text-to-audio

* Add depth-estimation

* Remove `render=False`

* Reorder the if-blocks following the Transformers.js doc

* Update gradio/pipelines_utils.py

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

* Update gradio/pipelines_utils.py

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

* Fix feature-extraction demo

* Fix demo title

* Add guides/08_gradio-clients-and-lite/gradio-lite-and-transformers-js.md without contents

* Rename guides/08_gradio-clients-and-lite/*.md to fix the order

* Use pipeline.model.config._name_or_path for the demo title instead of pipeline.model.config.model_type

* Fix normal Interface.from_pipeline to use pipeline.model.config.name_or_path as the demo title

* Write an article about Gradio-Lite and Transformers.js

* Update the doc

* tweaks

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* merge

* allow the canvas size to be set on the `ImageEditor` (#8127)

* add canvas size kwarg to imageeditor

* add changeset

* fix tests

* fix cropsize

* changes

* notebooks

* update docstrings

* fix type

* fix undefined dimensions

* Update image_editor.py

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

* fix type

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Rename `eventSource_Factory` and `fetch_implementation` (#8209)

* rename eventSource_factory -> stream_factory + rename event_source -> steam

* rename fetch_implementation -> fetch

* rename fetch to _fetch due to global.fetch conflict

* add changeset

* format

* format

* format

* format

* fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* remove redundant event source logic (#8211)

* remove redundant event source logic

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Only connect to heartbeat if needed (#8169)

* Add connect_heartbeat field

* fix types

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* chore: update versions (#8172)

* fixes

* type fixes

* type fixes

* notebook fix

* type ignore

* data object model

* remove component in tuple

* more fixes

* extend components

* remove test var

* extend to all components backend

* remove loading data models

* conflict fix

* test and type fixes

* playwright test

* PR fixes

* final changes

* Add pltly for 2e2 test

* pass loader to Gradio helper class

* fix things

* add changeset

* checks

* more fixy

* more fixy

* more fixy

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Simon Duerr <dev@simonduerr.eu>
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
Co-authored-by: Lê Ngọc Hoa <114990730+h2oa@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: James Zhou <61927718+jameszhou02@users.noreply.github.com>
Co-authored-by: Tiger3018 <tiger3018of02@gmail.com>
2024-06-14 14:43:35 +00:00
pngwn
546d14e4f2
add test + demo (#8524) 2024-06-10 21:33:28 +01:00
pngwn
9d2d6051ca
Change client submit API to be an AsyncIterable and support more platforms (#8451)
* fix param name

* format

* save

* changes

* changes

* fix param name

* format

* switch to async iterable interface

* switch to async iterable interface

* changes

* add changeset

* fix

* fix param name

* format

* fixes

* fix checks

* fix checks

* add changeset

* fix checks

* add changeset

* add changeset

* fix checks

* fix param name

* format

* fix types

* cleanup comments

* add changeset

* fix param name

* format

* changes

* Refactor Cancelling Logic To Use /cancel (#8370)

* Cancel refactor

* add changeset

* add changeset

* types

* Add code

* Fix types

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* fix param name

* format

* changes

* fix

* fix param name

* format

* fix test

* fix notebooks

* fix type

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2024-06-06 13:16:14 +01:00
aliabid94
8c18114495
changes (#8469)
Co-authored-by: Ali Abid <aliabid94@gmail.com>
2024-06-06 11:08:14 +01:00
pngwn
96d8de2312
add delete event to File component (#8417)
* fix param name

* format

* add delete event to File component

* fix

* add changeset

* fix

* fix

* fix

* add changeset

* format

* add changeset

* file file layout

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-06-05 12:14:10 +00:00
aliabid94
4a55157ed9
state.change listener with deep hash check (#8446)
* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* Update guides/04_building-with-blocks/04_dynamic-apps-with-render-decorator.md

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

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-06-04 14:19:30 -07:00
aliabid94
1a124d95d7
More gr.render content (#8418)
* changes

* Update 04_dynamic-apps-with-render-decorator.md

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
2024-05-30 14:15:35 -07:00
aliabid94
8028c33bbc
Render decorator documentation (#8409)
* changes

* changes

* add changeset

* fix dependency loop and documentation group

* add changeset

* changes

* fix numbered list

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
2024-05-29 14:13:51 -07:00
aliabid94
55f664f297
Add event listener support to render blocks (#8243)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changeas

* changes

* add changeset

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* cganges

* changes

* changes

* changes

* changes

* add changeset

* changes

* chagnes

* changes

* changes

* changes

* changes

* changes

* js

* remove console log

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* chnages

* changes

* cnages

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* Add `state.change` listener (#8297)

* state changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-22 14:51:53 -07:00
Freddy Boulton
c6495e1c87
Add auth to demo (#8305) 2024-05-16 13:08:21 -04:00
pngwn
fbf4edde7c
Client fixes (#8272)
* fix param name

* fix hidden state variable

* pass jwt to heartbeat event

* notebooks

* format

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-05-13 15:35:07 +01:00
aliabid94
5436031f92
Render decorator 2 (#8110)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changeas

* changes

* add changeset

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* cganges

* changes

* changes

* changes

* changes

* add changeset

* changes

* chagnes

* changes

* changes

* changes

* changes

* remove console log

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-06 08:36:07 -07:00
Yuichiro Tachibana (Tsuchiya)
937c858371
Use orjson to serialize dict including np.array (#8041)
* Use orjson to serialize dict including np.array

* add changeset

* Update json_component demo and add an E2E test using it

* Rename demo/json_component -> demo/json_component_blocks

* Add json_component_interface demo and an E2E test using it

* Fix to await assertion promises

* Revert renaming of json_component demo

* add changeset

* Rename js/app/test/json_component_blocks.spec.ts -> js/app/test/json_component.spec.ts

* Revert changes in routes.py and add orjson to json_component.py

* Update gr.Checkbox.postprocess to ensure a bool value is returned

* add changeset

* Remove the if-block in gr.Checkbox.postprocess handling NumPy arrays as they are not reasonable values to be interpreted as checkbox's value

* Update gr.JSON's docstring

* Add test/components/test_json_component.py

* Remove JSON component E2E tests

* Update gr.JSON's docstring

* docstring

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-25 16:13:01 +09:00
Freddy Boulton
2afca65419
Add max_file_size parameter to launch() that limits the size of files that can be uploaded in the Gradio app (#7909)
* File size limits

* Implementation

* add changeset

* Fix tests

* python client support

* lint

* fix test

* lint

* add changeset

* Set at the blocks level

* add changeset

* type check

* format

* lint

* lint

* Delete files as soon as they're encountered

* fix tests

* type hint 🙄

* Fix tests

* Fix below limit test

* add changeset

* Fix tests

* Add client file

* revert loop code

* Add to guides

* Pass in via gradio component

* add changeset

* Update loading status

* Make errors closeable

* add changeset

* Add code

* Lint

* Changelog highlight

* Fix i18n in storybook

* Address comments

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-19 15:38:53 -04:00
pngwn
074ce3805a
ensure the ImageEditor works correctly with layers and change events (#8059)
* stuff

* fix layrs

* add changeset

* lint

* ensure a default image can be passed when sources list is empty

* fix loading status

* add layers option to disable layer ui

* types

* fix tests

* cleanup

* cleanup

* notebooks

* fix composite

* fix

* fix trash icon

* add changeset

* fix layer bg

* fix error display

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-18 15:55:00 +00:00
pngwn
92139f3d7d
refresh the ImageEditor UI (#8042)
* changes

* icons

* asd

* add changeset

* ui

* fix empty text position

* fix button toggle

* cleanup

* add changeset

* lint

* fix test

* fix again

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-17 16:45:35 -04:00
Yuichiro Tachibana (Tsuchiya)
522daf787a
Patch async_save_url_to_cache for Lite (#8026)
* Update `async_save_url_to_cache` to work on Wasm

* Refactoring `save_url_to_cache`

* add changeset

* Fix

* Use pyodide.http as a custom transport of httpx

* Use urllib3 as a custom transport of httpx to make sync http requests

* Add an E2E test case to detect the bugs on remote resource caching

* add changeset

* Add image_remote_url E2E test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-17 03:54:34 +09:00
Dawood Khan
55ef4a52c3
Fixes Chatbot Image Sizing (#8025)
* fix

* add changeset

* fix

* notebook fix

* clean

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-16 16:38:20 +02:00
pngwn
6fafce0670
ensure maps are correctly shallow cloned when updating state (#8028)
* ensure maps are correctly shallow cloned when updating state

* cleanup

* add changeset

* fix test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-15 17:26:15 -04:00
pngwn
dbb7373dde
ensure ImageEditor events work as expected (#7845)
* changes

* changes

* more fix

* more fix

* add changeset

* fix initial crop

* fix format

* fix format

* fix formats

* faster?

* race condition

* fixes + test

* fix type?

* notebooks

* fix type

* change demo

* add changeset

* fix type

* fix type

* fix type again

* fix type again again

* lint

* lint again

* fix test

* tests

* fix

* tests

* address comments

* fix notebooks

* fix tests

* fix stories

* fix webcam ui

* cleanup

* add changeset

* fix input event

* add format param + fix input event

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-15 20:16:07 +00:00
Freddy Boulton
c1df2f818c
Fix example loading for custom components (#7981)
* format

* add changeset

* add changeset

* Update component

* Add tests

* Add code

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-10 17:52:41 -04:00
aliabid94
7c9a964ac6
Fix programmatic tab selection (#7916)
* changes

* changes

* add changeset

* changes

* add changeset

* changes

* add changeset

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-08 11:34:25 -07:00
pngwn
1eb4c20120
ensure kwargs are always in sync across the whole application (#7963)
* ensure kwargs are always in sync across the whole application

* add changeset

* fix test

* update accordion test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-08 18:12:14 +01:00
aliabid94
9666854790
Fixes streaming event race condition (#7926)
* changes

* add changeset

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-04 12:39:44 -07:00
Freddy Boulton
efd9524508
Fix gr.CheckboxGroup change event (#7915) 2024-04-03 07:19:58 -07:00
Freddy Boulton
6a4bf7abe2
Delete user state when they close the tab. Add an unload event for the demo and a delete_callback on gr.State to let developers control how resources are cleaned up (#7829)
* Delete state

* add changeset

* Delete state

* WIP

* Add load event

* Working ttl

* unload e2e test

* Clean up

* add changeset

* Fix notebook

* add changeset

* Connect to heartbeat in python client

* 15 second heartbeat

* Demo for unload

* Add notebook

* add changeset

* Fix docs

* revert demo changes

* Add docstrings

* lint 🙄

* Edit

* handle shutdown issue

* state comments

* client test

* Fix:

* Fix e2e test

* 3.11 incompatibility

* delete after one hour

* lint + highlight

* Update .changeset/better-tires-shave.md

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

* Update .changeset/better-tires-shave.md

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

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-04-01 18:31:56 -04:00
aliabid94
5e66e01abc
Fix audio streaming out (#7881)
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-01 02:25:16 -07:00
aliabid94
7bbc3b62bf
JS functions break entire app if there's no input, fixed (#7865)
* changes

* add changeset

* add changeset

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-28 14:54:46 -07:00
Freddy Boulton
ee804b2d56
Stop running iterators when js client disconnects (#7835)
* Add code

* add changeset

* move

* add changeset

* Add code

* Format notebook

* Address comments

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 17:41:40 +00:00