Commit Graph

6639 Commits

Author SHA1 Message Date
Dawood Khan
8d7b3caebd
Multimodal Textbox Loading + other fixes (#7848)
* submit button icon

* loader

* add changeset

* pr fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-27 12:31:58 -07:00
Yuichiro Tachibana (Tsuchiya)
e3b12369b7
Lazy-import pandas (#7851)
* Lazy-import pandas

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 12:13:48 -07:00
Abubakar Abid
7af3cd7ccb
Adds a placeholder argument to gr.Chatbot (#7849)
* add placeholder

* add changeset

* add test

* format

* lint

* chatbot

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 12:13:17 -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
Yuichiro Tachibana (Tsuchiya)
72661e3391
Revert the minify setting in vite.config.js which was mistakingly introduced in #6261 (#7852)
* Revert the minify setting in vite.config.js which was mistakingly introduced in #6261

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 19:03:25 +09:00
Yuichiro Tachibana (Tsuchiya)
ecf5c524c2
Fix gradio/components/dataframe.py not to import pandas.io (#7840)
* Fix gradio/components/dataframe.py not to import `pandas.io`

* add changeset

* add changeset

* Fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-27 10:39:57 +09:00
Abubakar Abid
75a2bf745d
Add guide on Client state and and fix default values of components (#7830)
* add guide and default values

* add changeset

* reset session

* fix

* add changeset

* fix tests'

* Update guides/08_gradio-clients-and-lite/01_getting-started-with-the-python-client.md

Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2024-03-26 21:10:43 +00:00
Abubakar Abid
05db0c4a59
Refactor CORS Middleware to be much faster (#7801)
* changes

* add changeset

* log

* add changeset

* changes

* changes

* lint

* middlware

* lint

* lint

* s
implified docstring

* fix

* revert test change

* docstring

* remove print

* update

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-26 13:17:38 -07:00
Abubakar Abid
8b099a07a5
Additional documentation related to nginx and root_url (#7832)
* nginx docs

* Update guides/09_other-tutorials/running-gradio-on-your-web-server-with-nginx.md

Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>

---------

Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2024-03-26 18:49:24 +00:00
Yuichiro Tachibana (Tsuchiya)
1a7c8d3223
Stop importing gradio.ipython_ext in Wasm mode (#7818)
* Stop importing gradio.ipython_ext in Wasm mode

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-26 16:43:30 +09:00
renovate[bot]
f18a33a1cc
Update dependency globals to v15 (#7837)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-25 23:28:15 -07:00
renovate[bot]
e5c3cc9620
Update dependency katex to v0.16.10 [SECURITY] (#7828)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-25 13:05:40 -07:00
aliabid94
61cb4fd711
Benchmarking scripts for load tests (#7670)
* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-17-237.us-west-2.compute.internal>
2024-03-25 12:30:57 -07:00
Shubham raj
1c257f5ebc
Bugfix: .. in filename throwing error while loading in output. (#7795)
* Exclude filename while preventing path traversal

* add changeset

* add changeset

* Check if path1 is a file and use path1
parent to compare

* explicit

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-25 19:27:42 +00:00
Yuichiro Tachibana (Tsuchiya)
e0a8b7fa2c
Exclude typer from the requirements list for Wasm env and fix gradio.cli not to be imported (#7823)
* Exclude `typer` from the requirements list for Wasm env and fix `gradio.cli` not to be imported

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-25 12:21:19 -07:00
pngwn
bf5110a26b
chore: update versions (#7771)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-25 12:35:44 -04:00
Dmytro Drach
f7df92f3f3
Improve UX of non-interactive slider (#7814)
* Fix disabled slider appearance

* add changeset

* tweaks

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
2024-03-25 15:10:10 +00:00
Yuichiro Tachibana (Tsuchiya)
ff6bf3ec8f
Remove the aiohttp mock from the Wasm worker as it's removed in https://github.com/gradio-app/gradio/pull/5244 (#7789)
* Remove the aiohttp mock from the Wasm worker as it's removed in https://github.com/gradio-app/gradio/pull/5244

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-23 23:29:49 +09:00
Yuichiro Tachibana (Tsuchiya)
2c8cd0a73d
Lazy-import altair (#7782)
* Lazy-import altair

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-23 16:43:42 +09:00
Ali Abdalla
c62a57e7f8
Convert Docs Demos to Lite (#7661)
* edit demos

* edit demos

* remove and replace demos

* convert docs demos to lite

* add changeset

* working

* styling

* notebook

* notebook

* formatting

* /docs embedding from spaces

* shared worker mode

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 17:32:23 -07:00
Abubakar Abid
b0a3ea951c
Small fix to client.view_api() in the case of default file values (#7800)
* fix view api page

* fix

* add changeset

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 17:27:03 -07:00
Freddy Boulton
cf98c7ed18
Adds trigger_mode to gr.on. Use it to set trigger_model="always_last" for live interfaces. (#7794)
* Dep + test

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 16:00:52 -07:00
Abubakar Abid
781678b3ac
Fix root url resolution from x_forwarded_host headers (#7787)
* logging

* add changeset

* fix

* remove print

* add changeset

* docstring

* add test

* add changeset

* docs fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 15:08:40 -07:00
Freddy Boulton
aad209f0c0
Decrease latency: do not run pre and postprocess in threadpool (#7796)
* revert

* add changeset

* lint

* explicit call

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 15:38:52 -04:00
Yuichiro Tachibana (Tsuchiya)
d831040032
Remove Ruff and Uvicorn in Wasm env (#7744)
* Exclude `ruff` from the requirements list for Wasm env

* Exclude `uvicorn` from the requirements list for Wasm env and fix the related modules not to try to import it when not used

* add changeset

* Fix tests

* add changeset

* Apply formatter

* Remove a test case which became unnecessary in https://github.com/gradio-app/gradio/pull/5267, ref: https://github.com/gradio-app/gradio/pull/7744#issuecomment-2011332287

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-22 17:32:59 +09:00
Abubakar Abid
2efb05ed99
Adds support for kwargs and default arguments in the python client, and improves how parameter information is displayed in the "view API" page (#7732)
* changes

* changes

* add changeset

* improvements to api docs ui

* add changeset

* ux design work

* further styling

* feedback

* add changeset

* get parameter name

* fix code snippet

* construct args

* add changeset

* construct_args

* utils

* changes

* add catches

* fixes

* valid

* fix tests

* js lint

* add tests

* add changeset

* format

* client

* doc

* fixes

* changes

* api docs fixes

* fix .view_api()

* updating guide wip

* guide

* updated guides'

* fix

* guide fixes

* filepath

* address review

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-21 17:18:13 -07:00
Freddy Boulton
755157f99c
Do not reload code inside gr.NO_RELOAD context (#7684)
* Add code

* Copy files

* I think its working

* Tidy up

* add changeset

* do not change demos

* test

* Don't copy files

* Add code

* lint

* Add reload mode e2e test

* Reload mode test

* add changeset

* add changeset

* Use NO_RELOAD

* add no reload to docs

* add changeset

* Fix docs

* handle else statements. No need to edit string

* Fix typos

* Use compile

* Do not use unparse

* notebook

* Documentation comments

* Fix top-package import without having to delete all modules

* Revert demo calculator

* Typo guides

* Fix website

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-21 15:59:53 -04:00
Freddy Boulton
43ae23f092
Fix accidental bug that prevented custom textboxes from being passed to chatinterface (#7783)
* Add code

* add changeset

* Update gradio/chat_interface.py

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-03-21 19:22:14 +00:00
Abubakar Abid
dd3e363261
Fail CI if lint or typecheck fails (#7770)
* fail

* test

* revert

* run shebang

* fix

* fixes

* add changeset

* changes

* bash

* not required

* file

* textbox

* add changeset

* changes to demo

* notebook

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-21 11:34:56 -04:00
Hannah
ca42748590
Ensure paginate updates when samples value changes in Dataset (#7761)
* ensure paginate updates when samples value changes

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-21 15:12:34 +00:00
Freddy Boulton
f73a9bbcd7
Fix theme gallery space (#7758) 2024-03-20 17:47:24 -04:00
Freddy Boulton
e78bca4f37
Trigger input event for Radio even when radio is output component (#7762)
* Add code

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-20 16:58:33 -04:00
Freddy Boulton
9f8313f5a9
Configure playwright to automatically retry failing tests up to 3 times (#7764)
* Add retries to playwright

* lint

* Remove line
2024-03-20 16:38:15 -04:00
Hannah
4da44c4589
add diff threshold to image editor (#7763) 2024-03-20 17:09:04 +00:00
pngwn
4da194fc77
chore: update versions (#7669)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-19 13:50:31 -07:00
Dawood Khan
15da39fca0
Multimodal Textbox (Chat Input Component) (#7420)
* first pass

* multimodal textbox

* add changeset

* remove file

* more changes

* changes

* add changeset

* revert demo

* doc strings fix

* update demo

* file icons

* more updates

* format

* add story

* remove doc line

* type fixes

* chat interface

* new demo

* image upload fix

* ui changes

* addressing PR comments

* format

* type check

* more pr fixes

* format

* format

* test fixes

* test fixes

* Streaming fixes + other stuff

* optional keys to dict value

* final fixes

* notebook

* format

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* Update guides/04_chatbots/01_creating-a-chatbot-fast.md

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

* merge

* backend fixes

* story fix

* ui test fix

* format

* story

* format

* demo fix

* streaming test fix

* stories fix

* stories fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-19 13:16:05 -07:00
Dawood Khan
c9aba8d8a5
Fixes: gr.Markdown is not updated properly when it has an image tag (#7623)
* fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-19 12:52:03 -07:00
pngwn
41385f402b
fix dataframe stories (#7747) 2024-03-19 19:50:48 +00:00
David Löwenfels
853d945e75
Add format parameter to gr.Image, gr.Gallery, gr.AnnotatedImage, gr.Plot to control format to save image files in (#7680)
* WIP re: #7486. Make less PNG-centric.
preserve file format during upload
add format to image component

* more format preservation re: #7486

* lint

* lint; add comments; update Plot component

* add'l for Plot imaging defaults

* Working tests

* add changeset

* Add code

* test

* Add code

* add changeset

* Docstring improvements

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-19 19:29:27 +00:00
Ali Abdalla
f739bef6c7
Add Playground to Lite Custom Element (#7660)
* lite playground changes

* add changeset

* formatting

* index

* fix tests

* fixes

* add changeset

* styling changes

* code parsing

* formatting

* remove tailiwnd

* add shortcut

* formatting

* linting

* formatting

* snake case

* typing

* try fix

* remove import

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2024-03-19 11:49:21 -07:00
renovate[bot]
abb3f3c116
Update dependency happy-dom to v14 (#7736)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 11:47:03 -07:00
Hannah
a2badf151e
Migrate to Storybook 8 (#7743)
* migrate to storybook 8

* add changeset

* formatting

* test

* pnpm lock

* revert test

* update testing-library

* pass (and improve) failing tests

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-19 11:22:21 -07:00
Abubakar Abid
04857bc524
Add allowed_paths, blocked_paths, show_error, and favicon_path parameters to gr.mount_gradio_app (#7734)
* mount

* add params

* routes

* add changeset

* blocks

* fixes

* add changeset

* typo

* typo

* mount

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-19 10:56:20 -07:00
aliabid94
84f81fec92
Closing stream from the backend (#7691)
* chganges

* add changeset

* changes

* changes

* changes

* changes

* maybe fix (#7715)

* maybe fix

* fix with demo

* changeset

* fix demo

* changeset

* 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: pngwn <hello@pngwn.io>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-18 14:37:38 -07:00
Mike Heavers
7f9b291922
Cast button value as string in postprocess (#7733)
* Cast button value as string.

If you don't do this, it causes a problem on gradio app load - see github issue #7690
(https://github.com/gradio-app/gradio/issues/7690#issuecomment-1997718185)

* add changeset

* add test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-18 13:37:45 -07:00
Abubakar Abid
c5d20483b7
Revert "Replace httpx with requests library in save_url_to_cache to make it w…" (#7729)
This reverts commit 181f4d05d4.

Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
2024-03-18 08:03:02 -07:00
Yuichiro Tachibana (Tsuchiya)
7d3c868d0a
Detailed error message for wasm_utils.get_registered_app() (#7572)
* Detailed error message for wasm_utils.get_registered_app()

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2024-03-18 07:35:24 -07:00
Yuichiro Tachibana (Tsuchiya)
f67759dcee
Fix wasm_proxied_mount_css to not reuse an existing style element (#7709)
* Fix wasm_proxied_mount_css to not reuse an existing style element but replace it for theme updates upon rerunning a new app

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-18 07:30:11 -07:00
Yuichiro Tachibana (Tsuchiya)
0a3870d52b
Call handle_darkmode() even if window.__gradio_mode__ === "website" but enforce the light theme (#7710)
* Call handle_darkmode() even if `window.__gradio_mode__ === "website"` but enforce the light theme

* add changeset

* Rename functions

* Fix `handle_theme_mode()` not to access a variable `active_theme_mode` in an outer scope

* Rename use_system_theme to sync_system_theme

* Replace let with const

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-18 07:29:08 -07:00
Shubham raj
181f4d05d4
Replace httpx with requests library in save_url_to_cache to make it work in wasm mode (#7725)
* Replace httpx with requests library to make it work in wasm mode

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-18 17:19:55 +09:00