mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
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:
parent
ad9fb84f05
commit
683bdf7623
21
CHANGELOG.md
21
CHANGELOG.md
@ -1,22 +1,35 @@
|
||||
# Upcoming Release
|
||||
|
||||
## New Features:
|
||||
|
||||
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:
|
||||
|
||||
- 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)
|
||||
- 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).
|
||||
- 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:
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
|
||||
## Breaking Changes:
|
||||
|
@ -139,7 +139,10 @@ class ChatInterface(Blocks):
|
||||
submit_btn.render()
|
||||
elif isinstance(submit_btn, str):
|
||||
submit_btn = Button(
|
||||
submit_btn, variant="primary", scale=1, min_width=0
|
||||
submit_btn,
|
||||
variant="primary",
|
||||
scale=1,
|
||||
min_width=150,
|
||||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
|
@ -487,6 +487,8 @@ class Base(ThemeClass):
|
||||
background_fill_secondary_dark=None,
|
||||
border_color_accent=None,
|
||||
border_color_accent_dark=None,
|
||||
border_color_accent_subdued=None,
|
||||
border_color_accent_subdued_dark=None,
|
||||
border_color_primary=None,
|
||||
border_color_primary_dark=None,
|
||||
color_accent=None,
|
||||
@ -566,8 +568,6 @@ class Base(ThemeClass):
|
||||
# Component Atoms: These set the style for elements within components.
|
||||
chatbot_code_background_color=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_dark=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.
|
||||
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_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_dark: The border color primarily used for items placed directly on the page in dark mode.
|
||||
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", "400"
|
||||
)
|
||||
self.chatbot_user_message_border_color_accent = (
|
||||
chatbot_user_message_border_color_accent
|
||||
or getattr(
|
||||
self, "chatbot_user_message_border_color_accent", "*border_color_accent"
|
||||
)
|
||||
self.border_color_accent_subdued = border_color_accent_subdued or getattr(
|
||||
self, "border_color_accent_subdued", "*border_color_accent"
|
||||
)
|
||||
self.chatbot_user_message_border_color_accent_dark = (
|
||||
chatbot_user_message_border_color_accent_dark
|
||||
or getattr(
|
||||
self,
|
||||
"chatbot_user_message_border_color_accent_dark",
|
||||
"*border_color_accent",
|
||||
)
|
||||
self.border_color_accent_subdued_dark = (
|
||||
border_color_accent_subdued_dark
|
||||
or getattr(self, "border_color_accent_subdued_dark", "*border_color_accent")
|
||||
)
|
||||
# Component Atoms
|
||||
self.chatbot_code_background_color = chatbot_code_background_color or getattr(
|
||||
|
@ -92,5 +92,5 @@ class Default(Base):
|
||||
button_cancel_border_color_dark=colors.red.c600,
|
||||
button_cancel_text_color=colors.red.c600,
|
||||
button_cancel_text_color_dark="white",
|
||||
chatbot_user_message_border_color_accent="*primary_200",
|
||||
border_color_accent_subdued="*primary_200",
|
||||
)
|
||||
|
@ -1 +1 @@
|
||||
3.37.0
|
||||
3.38.0
|
||||
|
@ -236,7 +236,7 @@
|
||||
background: var(--background-fill-secondary);
|
||||
}
|
||||
.user {
|
||||
border-color: var(--chatbot-user-message-border-color-accent);
|
||||
border-color: var(--border-color-accent-subdued);
|
||||
background-color: var(--color-accent-soft);
|
||||
}
|
||||
.feedback {
|
||||
|
@ -19,6 +19,7 @@ def copy_all_demos(source_dir: str, dest_dir: str):
|
||||
"calculator",
|
||||
"cancel_events",
|
||||
"chatbot_multimodal",
|
||||
"chatinterface_streaming_echo",
|
||||
"clear_components",
|
||||
"code",
|
||||
"fake_gan",
|
||||
|
@ -27,16 +27,6 @@ class TestAnalytics:
|
||||
== "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")
|
||||
def test_error_analytics_doesnt_crash_on_connection_error(
|
||||
self, mock_post, monkeypatch
|
||||
|
Loading…
Reference in New Issue
Block a user