Commit Graph

432 Commits

Author SHA1 Message Date
pngwn
62c0a34a40
chore: update versions (#5992)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-19 15:28:58 +01:00
Yuichiro Tachibana (Tsuchiya)
0e0681fce7
Lite: Set wasClean: true on the CloseEvent emitted by WebSocket.close() (#6009)
* Set `wasClean: true` on the `CloseEvent` emitted by `WebSocket.close`

* add changeset

* Apply formatter

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-19 20:25:58 +09:00
Yuichiro Tachibana (Tsuchiya)
ec26b71dfb
Update static/AudioPlayerto use ../shared/Audio instead of the native <audio> for Wasm support (#6004)
* Update js/audio/static/AudioPlayer.svelte to use ../shared/Audio.svelte instead of the native `<audio>` for Wasm support

* add changeset

* Update markup and stying

* Apply formatter

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-19 18:35:07 +09:00
Yuichiro Tachibana (Tsuchiya)
e0ed0642ac
Lite: Error handling after initialization (#6005)
* Update WorkerProxy to emit a unified `error` event for any type error and a `run-start` event when `run_file` or `run_code` is called, and update Index.svelte to handle these events

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-19 17:39:23 +09:00
Yuichiro Tachibana (Tsuchiya)
584fd97d59
Lite fix matplotlib install postprocess (#5998)
* Fix the postprocessing after installing matplotlib

* Apply formatter

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-19 13:12:55 +09:00
Abubakar Abid
b8b9f6d27e
Adds a Guide on how to stylize the DataFrame component (#5936)
* add guide

* fix prev and next guide hrefs

* make prev and next reactive

* add changeset

---------

Co-authored-by: aliabd <ali.si3luwa@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-18 14:55:31 -07:00
pngwn
7415ffb0d8
chore: update versions (#5981)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-18 20:06:23 +01:00
Yuichiro Tachibana (Tsuchiya)
ab1e5da557
Lite: Fix error handling on the ASGI app (#5982) 2023-10-18 18:38:18 +01:00
Yuichiro Tachibana (Tsuchiya)
a32aabaf50
Lite: Show initialization progress messages (#5983) 2023-10-18 18:37:14 +01:00
Yuichiro Tachibana (Tsuchiya)
d8a6491a18
Specify FastAPI version for the Wasm runtime as a workaround (#5987) 2023-10-18 18:30:33 +01:00
Yuichiro Tachibana (Tsuchiya)
686719a3b0
Lite: Explicitly install a specific version of anyio to avoid version conflicts (#5980)
* Lite: Explicitly install a specific version of `anyio` to avoid version conflicts

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-18 18:16:58 +09:00
pngwn
27d73cf2cd
chore: update versions (#5976)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-18 00:27:20 -07:00
Abubakar Abid
ddd9749561
Just a small tweak to trigger a release of @gradio/lite (#5975)
* tweak

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-18 00:11:50 -07:00
pngwn
35f58db405
chore: update versions (#5940)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-17 23:38:35 -07:00
Yuichiro Tachibana (Tsuchiya)
11a3007916
Lite: Support opening the entrypoint HTML page directly in browser via the file: protocol (#5972)
* Use a special fake hostname for the API access when the page is opened via the `file:` protocol

* Move js/app/src/lite/url.ts -> js/wasm/svelte/host.ts

* Add a comment

* Move js/wasm/svelte/host.ts -> js/wasm/network/host.ts

* add changeset

* Add a comment

* add changeset

* Update js/wasm/package.json adding a ESM subpath

* Fix `is_self_host()`

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-10-17 23:25:01 -07:00
Yuichiro Tachibana (Tsuchiya)
921334526f
Lite: Support the custom HTML element syntax <gradio-lite> (#5953)
* Create a custom element `<gradio-app`> for Gradio-lite

* Parse `<gradio-app`> attributes to configure the top level component

* Move custom-element code to lite/custom-element module

* add changeset

* Apply formatter

* Rename the custom element `<gradio-app>` to `<gradio-lite>`

* Fix the .gradio-lite to be minimum

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-10-18 15:07:13 +09:00
Yuichiro Tachibana (Tsuchiya)
6780d660bb
Make the HTTP requests for the Wasm worker wait for the initial run_code() or run_file() to finish (#5958)
* Make the HTTP requests for the Wasm worker wait for the initial `run_code()` or `run_file()` to finish

* add changeset

* Support top-level await with `run_file()`

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-10-17 11:49:40 -07:00
Yuichiro Tachibana (Tsuchiya)
f769876e0f
Apply formatter (and small refactoring) to the Lite-related frontend code (#5956)
* Apply formatter (and small refactoring) to the Lite-related frontend code

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-18 01:15:00 +09:00
Hannah
465f58957f
Show empty JSON icon when value is null (#5944)
* show empty json icon when value is null

* add changeset

* move empty check logic to parent component

* add changeset

* revert changes

* add changeset

* tweak

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-17 15:11:28 +02:00
Abubakar Abid
fee3d527e8
Adds column_widths to gr.Dataframe and hide overflowing text when wrap=False (#5894)
* changes

* added prop

* add changeset

* table

* null case

* fix tests

* add story

* format

* lint

* add changeset

* Update js/dataframe/shared/Table.svelte

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

* add support for ints

* added test

* docstring

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabid94 <aabid94@gmail.com>
2023-10-16 16:14:11 -07:00
pngwn
a46cb94870
chore: update versions (#5831)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-16 13:30:41 -07:00
Ali Abdalla
8d909624f6
Fix styling issues with Audio, Image and Video components (#5934)
* audio styling fix

* video styling fix

* image examples styling fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-16 12:51:05 -07:00
Dawood Khan
3618238960
Fix dataframe line_breaks (#5930)
* fix

* format

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-16 11:36:22 -07:00
Yuichiro Tachibana (Tsuchiya)
b67115e8e6
Lite: Make the Examples component display media files using pseudo HTTP requests to the Wasm server (#5627)
* Create a Wasm-compatible <Image> component in @gradio/lite and use it in @gradio/image/example/Image.svelte

* add changeset

* Fix Image styling

* Move js/wasm/svelte/Image.svelte -> js/image/static/Image.svelte

* Shorten CSS class name

* Create Wasm-compatible video components

* add changeset

* Move the Wasm-compatible `Image` from `static` to `shared`

* Create Wasm-compatible audio components

* Fix `resolve_wasm_src()` to return the passed `src` as-is when the URL is not HTTP or refering to remote

* add changeset

* Fix `resolve_wasm_src()`

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-17 01:26:49 +09:00
Yuichiro Tachibana (Tsuchiya)
1724918f06
Lite: Add a break statement (#5919)
* Add a break statement

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-16 12:36:53 +09:00
Dawood Khan
0592c301df
Fix Dataframe line_breaks (#5897)
* fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-15 18:29:39 -07:00
Yuichiro Tachibana (Tsuchiya)
121f25b2d5
Lite: Fix is_self_host() to detect 127.0.0.1 as localhost as well (#5886)
* Fix is_self_host() to detect `127.0.0.1` as localhost as well

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-13 13:57:21 +09:00
Abubakar Abid
a55b809423
Add styling (e.g. font colors and background colors) support to gr.DataFrame through the pd.Styler object (#5877)
* colors

* add changeset

* revert

* revert

* colors

* move box shadow

* done

* lint

* lint

* fixes

* lint

* added focused false

* revert focus

* revert focus

* revert focus

* revert focus

* revert focus

* apply style to td instead

* dataframe

* lint

* test

* Update js/dataframe/shared/Table.svelte

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

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabid94 <aabid94@gmail.com>
2023-10-12 15:45:55 -07:00
Aileen Villanueva Lecuona
e70805d54c
Change BlockLabel element to use <label> (#5864)
* refactor: change to label tag where label property is accepted by component

BlockLabel is being used as the main component for labels and should address the issue reported in Chat and File component

closes issue 5454

* add changeset

* fix: A form label must be associated with a control.

* Update js/atoms/src/BlockLabel.svelte

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

* add changeset

* add changeset

* fix: refactor use label tag instead of div tag
Change CSS styles from div to label selector in BlockLabel

* fix: A form label must be associated with a control

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Hannah <hannahblair@users.noreply.github.com>
2023-10-12 13:13:03 +02:00
Yuichiro Tachibana (Tsuchiya)
ead265c1b9
Lite: Convert an error object caught in the worker to be cloneable (#5838)
* Convert an error object caught in the worker to be cloneable so it can be delegated to the main thread properly

* add changeset

* Add a comment

* Fix the error serialization for the inter-thread messaging

* Fix reply error message

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
2023-10-12 15:49:52 +09:00
Abubakar Abid
fbce277e50
Keep Markdown rendered lists within dataframe cells (#5878)
* df bullets

* keep bullets inside dataframe columns

* don't apply to chatbot

* added ols

* add changeset

* fix white space a

* add changeset

* revert change

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-11 20:52:56 -07:00
pngwn
4e0d87e9c4
fix @gradio/lite dependencies (#5868)
* publish @gradio/wasm

* add changeset

* fix deps

* add changeset

* revert publish

* fix lockfile

* add changeset

* fix lockfile

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-11 09:56:02 +01:00
Kit PANG
b83064da00
Fix error when scrolling dropdown with scrollbar (#5839)
* Fix error when scrolling dropdown with scrollbar

* added comment

* add changeset

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-08 18:34:05 -07:00
Dawood Khan
48e09ee887
Quick fix: Chatbot change event (#5827)
* fix

* add changeset

* add dequal to dependency

* package

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-10-06 11:16:59 -07:00
pngwn
1265a9ac13
chore: update versions (#5817)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-05 19:55:12 -07:00
pngwn
3d263ba007
chore: update versions (#5796)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-05 14:10:45 -07:00
Abubakar Abid
a0d3cc45c6
Fix gr.SelectData so that the target attribute is correctly attached, and the filedata is included in the data attribute with gr.Gallery (#5798)
* fix select

* add changeset

* add changeset

* restore

* refactor

* add pytest

* typo

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-05 12:53:52 -07:00
Abubakar Abid
4567788bd1
Adds the ability to set the selected_index in a gr.Gallery (#5783)
* selected_index

* Gallery

* changes

* modify

* add changeset

* fix select issue

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-05 11:35:42 -07:00
Abubakar Abid
957ba5cfde
Prevent bokeh from injecting bokeh js multiple times (#5795)
* remove dep line in demo

* linting

* linting

* fix

* merge

* add changeset

* lint

* notebook:

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-05 11:17:49 -07:00
aliabid94
e4a307ed6c
Add component <-> server direct communication support, as well as a "file explorer" component (#5672)
* changes

* changes

* add changeset

* add changeset

* Server fns ext (#5760)

* start changes

* changes

* changes

* fix arrows

* add changeset

* rename demo

* fix some ci

* add changeset

* add changeset

* fix

* remove configs

* fix

* fix

* add changeset

* fixes

* linting

* Update gradio/components/file_explorer.py

* notebook

* typing

* tweaks

* fixed class method problem

* fix test

* file explorer

* gr.load

* format

* tweaks

* fix

* fix

* fix

* fix

* final tweaks + changelog

* changelog

* changelog

* changelog

* lint

---------

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>
2023-10-05 14:20:01 +01:00
Hannah
f096c3ae16
Throw helpful error when media devices are not found (#5794)
* add test

* add changeset

* tweak copy

* error logic

* add changeset

* copy tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-04 20:31:00 +01:00
Abubakar Abid
ed0f9a21b0
Adds change() event to gr.Gallery (#5780)
* add change event to gallery

* revert

* format

* add changeset

* lint

* add tests

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-04 12:25:03 -07:00
pngwn
5d5ddcfa9b
chore: update versions (#5786)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-04 15:46:45 +01:00
Hannah
e2874bc3cb
fix pending chatbot message styling and ensure messages with value None don't render (#5775)
* fix pending chatbot message styling

* border fixes

* add changeset

* add changeset

* ensure null messages arent shown

* add hide css again

* render loading inside message + add test

* fix test

* add changeset

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-04 14:50:19 +01:00
Yuichiro Tachibana (Tsuchiya)
6e56a0d9b0
Lite: Websocket queueing (#5124)
* Create a Wasm-emulated WebSocket connection and fix @gradio/client to inject it

* Explicitly set the default response class for the Wasm mode

* add changeset

* Fix is_self_origin() to compare only hosts and rename it to is_self_host()

* Fix Blocks.close() to cancel async tasks in the case of Wasm and call it from wasm_utils.register_app() to dispose an old app instance

* Update comment

* Hold the asyncio.Task objects and cancel them at `Blocks.close()`

* Add try-except to handle the case where `events` is not set to `queue.active_jobs` when `queue.process_events` is called

* Format queueing.py

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-04 18:19:09 +09:00
pngwn
d6295df030
chore: update versions (#5742)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-02 20:55:55 -07:00
Dawood Khan
e842a561af
Fix new line issue in chatbot (#5755)
* fix new line

* add changeset

* line breaks param

* add changeset

* fix test

* Update gradio/components/chatbot.py

* Update gradio/components/dataframe.py

* Update gradio/components/markdown.py

* add changeset

* fix static markdown

* lint

* line breaks

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-10-02 20:44:58 -07:00
Abubakar Abid
502054848f
Fix Gallery columns and rows params (#5754)
* fix gallery params

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-02 20:11:09 -07:00
Abubakar Abid
2a5b9e03b1
Added support for pandas Styler object to gr.DataFrame (initially just sets the display_value) (#5569)
* adding precision to df

* add changeset

* docstring

* precision

* add changeset

* fix

* fixes

* add changeset

* add visual test

* lint

* fixes

* lint

* format

* add changeset

* ts changes

* analytics

* dataframe typing

* typing

* demo

* fix

* lint

* interactive dataframe

* dataframe

* fix typing

* add test

* upgrade pandas version

* fix pandas version

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-02 14:02:03 -07:00
Hannah
8f0fed857d
Improve chatbot accessibility and UX (#5699)
* add a11y changes and css tweaks

* add a11y changes and css tweaks

* change like/dislike/copy buttons ux

* cleanup

* add laout param

* tweak

* add changeset

* fill icon on click

* text alignment tweak

* format + test

* fix browser test

* avatar tweaks

* add stories

* tweak

* tweak

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-02 19:29:20 +02:00