Release 3.38 (#4991)

* release

* changelog

* changelog

* changelog

* chatbot

* remove test

* Add code

* add min width to submit button

---------

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
This commit is contained in:
Abubakar Abid 2023-07-21 00:57:35 +03:00 committed by GitHub
parent ad9fb84f05
commit 683bdf7623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 32 deletions

View File

@ -1,22 +1,35 @@
# Upcoming Release # Upcoming Release
## New Features:
No changes to highlight. No changes to highlight.
## Bug Fixes:
No changes to highlight.
## Breaking Changes:
No changes to highlight.
## Other Changes:
No changes to highlight.
# Version 3.38
## New Features: ## New Features:
- Provide a parameter `animate` (`False` by default) in `gr.make_waveform()` which animates the overlayed waveform by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4918](https://github.com/gradio-app/gradio/pull/4918) - Provide a parameter `animate` (`False` by default) in `gr.make_waveform()` which animates the overlayed waveform by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4918](https://github.com/gradio-app/gradio/pull/4918)
- Add `show_download_button` param to allow the download button in static Image components to be hidden by [@hannahblair](https://github.com/hannahblair) in [PR 4959](https://github.com/gradio-app/gradio/pull/4959) - Add `show_download_button` param to allow the download button in static Image components to be hidden by [@hannahblair](https://github.com/hannahblair) in [PR 4959](https://github.com/gradio-app/gradio/pull/4959)
- Added autofocus argument to Textbox by [@aliabid94](https://github.com/aliabid94) in [PR 4978](https://github.com/gradio-app/gradio/pull/4978) - Added autofocus argument to Textbox by [@aliabid94](https://github.com/aliabid94) in [PR 4978](https://github.com/gradio-app/gradio/pull/4978)
- The `gr.ChatInterface` UI now converts the "Submit" button to a "Stop" button in ChatInterface while streaming, which can be used to pause generation. By [@abidlabs](https://github.com/abidlabs) in [PR 4971](https://github.com/gradio-app/gradio/pull/4971). - The `gr.ChatInterface` UI now converts the "Submit" button to a "Stop" button in ChatInterface while streaming, which can be used to pause generation. By [@abidlabs](https://github.com/abidlabs) in [PR 4971](https://github.com/gradio-app/gradio/pull/4971).
- Add a `border_color_accent_subdued` theme variable to add a subdued border color to accented items. This is used by chatbot user messages. Set the value of this variable in `Default` theme to `*primary_200`. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4989](https://github.com/gradio-app/gradio/pull/4989)
## Bug Fixes: ## Bug Fixes:
- Fixes `cancels` for generators so that if a generator is canceled before it is complete, subsequent runs of the event do not continue from the previous iteration, but rather start from the beginning. By [@abidlabs](https://github.com/abidlabs) in [PR 4969](https://github.com/gradio-app/gradio/pull/4969). - Fixes `cancels` for generators so that if a generator is canceled before it is complete, subsequent runs of the event do not continue from the previous iteration, but rather start from the beginning. By [@abidlabs](https://github.com/abidlabs) in [PR 4969](https://github.com/gradio-app/gradio/pull/4969).
- Use `gr.State` in `gr.ChatInterface` to reduce latency by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4976](https://github.com/gradio-app/gradio/pull/4976) - Use `gr.State` in `gr.ChatInterface` to reduce latency by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4976](https://github.com/gradio-app/gradio/pull/4976)
- Add a `chatbot_user_message_border_color_accent` theme variable to control the border color of user messages in a chatbot by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4989](https://github.com/gradio-app/gradio/pull/4989). Set the value of this variable in `Default` theme to `*primary_200`.
## Bug Fixes:
- Fix bug with `gr.Interface` where component labels inferred from handler parameters were including special args like `gr.Request` or `gr.EventData`. By [@cbensimon](https://github.com/cbensimon) in [PR 4956](https://github.com/gradio-app/gradio/pull/4956) - Fix bug with `gr.Interface` where component labels inferred from handler parameters were including special args like `gr.Request` or `gr.EventData`. By [@cbensimon](https://github.com/cbensimon) in [PR 4956](https://github.com/gradio-app/gradio/pull/4956)
## Breaking Changes: ## Breaking Changes:

View File

@ -139,7 +139,10 @@ class ChatInterface(Blocks):
submit_btn.render() submit_btn.render()
elif isinstance(submit_btn, str): elif isinstance(submit_btn, str):
submit_btn = Button( submit_btn = Button(
submit_btn, variant="primary", scale=1, min_width=0 submit_btn,
variant="primary",
scale=1,
min_width=150,
) )
else: else:
raise ValueError( raise ValueError(

View File

@ -487,6 +487,8 @@ class Base(ThemeClass):
background_fill_secondary_dark=None, background_fill_secondary_dark=None,
border_color_accent=None, border_color_accent=None,
border_color_accent_dark=None, border_color_accent_dark=None,
border_color_accent_subdued=None,
border_color_accent_subdued_dark=None,
border_color_primary=None, border_color_primary=None,
border_color_primary_dark=None, border_color_primary_dark=None,
color_accent=None, color_accent=None,
@ -566,8 +568,6 @@ class Base(ThemeClass):
# Component Atoms: These set the style for elements within components. # Component Atoms: These set the style for elements within components.
chatbot_code_background_color=None, chatbot_code_background_color=None,
chatbot_code_background_color_dark=None, chatbot_code_background_color_dark=None,
chatbot_user_message_border_color_accent=None,
chatbot_user_message_border_color_accent_dark=None,
checkbox_background_color=None, checkbox_background_color=None,
checkbox_background_color_dark=None, checkbox_background_color_dark=None,
checkbox_background_color_focus=None, checkbox_background_color_focus=None,
@ -729,6 +729,8 @@ class Base(ThemeClass):
background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode. background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.
border_color_accent: The border color used for accented items. border_color_accent: The border color used for accented items.
border_color_accent_dark: The border color used for accented items in dark mode. border_color_accent_dark: The border color used for accented items in dark mode.
border_color_accent_subdued: The subdued border color for accented items.
border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.
border_color_primary: The border color primarily used for items placed directly on the page. border_color_primary: The border color primarily used for items placed directly on the page.
border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode. border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.
color_accent: The color used for accented items. color_accent: The color used for accented items.
@ -1204,19 +1206,12 @@ class Base(ThemeClass):
self.section_header_text_weight = section_header_text_weight or getattr( self.section_header_text_weight = section_header_text_weight or getattr(
self, "section_header_text_weight", "400" self, "section_header_text_weight", "400"
) )
self.chatbot_user_message_border_color_accent = ( self.border_color_accent_subdued = border_color_accent_subdued or getattr(
chatbot_user_message_border_color_accent self, "border_color_accent_subdued", "*border_color_accent"
or getattr(
self, "chatbot_user_message_border_color_accent", "*border_color_accent"
)
) )
self.chatbot_user_message_border_color_accent_dark = ( self.border_color_accent_subdued_dark = (
chatbot_user_message_border_color_accent_dark border_color_accent_subdued_dark
or getattr( or getattr(self, "border_color_accent_subdued_dark", "*border_color_accent")
self,
"chatbot_user_message_border_color_accent_dark",
"*border_color_accent",
)
) )
# Component Atoms # Component Atoms
self.chatbot_code_background_color = chatbot_code_background_color or getattr( self.chatbot_code_background_color = chatbot_code_background_color or getattr(

View File

@ -92,5 +92,5 @@ class Default(Base):
button_cancel_border_color_dark=colors.red.c600, button_cancel_border_color_dark=colors.red.c600,
button_cancel_text_color=colors.red.c600, button_cancel_text_color=colors.red.c600,
button_cancel_text_color_dark="white", button_cancel_text_color_dark="white",
chatbot_user_message_border_color_accent="*primary_200", border_color_accent_subdued="*primary_200",
) )

View File

@ -1 +1 @@
3.37.0 3.38.0

View File

@ -236,7 +236,7 @@
background: var(--background-fill-secondary); background: var(--background-fill-secondary);
} }
.user { .user {
border-color: var(--chatbot-user-message-border-color-accent); border-color: var(--border-color-accent-subdued);
background-color: var(--color-accent-soft); background-color: var(--color-accent-soft);
} }
.feedback { .feedback {

View File

@ -19,6 +19,7 @@ def copy_all_demos(source_dir: str, dest_dir: str):
"calculator", "calculator",
"cancel_events", "cancel_events",
"chatbot_multimodal", "chatbot_multimodal",
"chatinterface_streaming_echo",
"clear_components", "clear_components",
"code", "code",
"fake_gan", "fake_gan",

View File

@ -27,16 +27,6 @@ class TestAnalytics:
== "unable to parse version details from package URL." == "unable to parse version details from package URL."
) )
@mock.patch("requests.Response.json")
def test_should_warn_url_not_having_version(self, mock_json, monkeypatch):
monkeypatch.setenv("GRADIO_ANALYTICS_ENABLED", "True")
mock_json.return_value = {"foo": "bar"}
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
analytics.version_check()
assert str(w[-1].message) == "package URL does not contain version info."
@mock.patch("requests.post") @mock.patch("requests.post")
def test_error_analytics_doesnt_crash_on_connection_error( def test_error_analytics_doesnt_crash_on_connection_error(
self, mock_post, monkeypatch self, mock_post, monkeypatch