Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodkhan82 committed Dec 23, 2024
2 parents a846b38 + 45df1b1 commit d8d64bc
Show file tree
Hide file tree
Showing 234 changed files with 3,657 additions and 1,078 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"gradio": minor
---

feat:Improve uploaded file UI in Chatbot
feat:Allow editing chatbot messages
6 changes: 0 additions & 6 deletions .changeset/brave-plants-pay.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/brave-walls-beam.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/clear-hats-shout.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cyan-suns-judge.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/easy-buckets-judge.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/evil-hoops-attack.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fair-bees-report.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/famous-shoes-lose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Add support for returning multiple messages from `gr.ChatInterface` chat function
5 changes: 0 additions & 5 deletions .changeset/fast-wings-wave.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/fifty-crabs-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/chatbot": patch
"gradio": patch
---

fix:Some agent low-hanging issues
7 changes: 7 additions & 0 deletions .changeset/fluffy-pots-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gradio/audio": minor
"@gradio/multimodaltextbox": minor
"gradio": minor
---

feat:Add Microphone Input to MultimodalTextbox
6 changes: 0 additions & 6 deletions .changeset/hot-knives-hope.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/kind-laws-heal.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/legal-geese-taste.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/little-bees-sink.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/loose-kids-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@self/app": minor
"@self/spa": minor
"gradio": minor
---

feat:`manifest json` for PWA
7 changes: 7 additions & 0 deletions .changeset/major-walls-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gradio/file": patch
"@gradio/upload": patch
"gradio": patch
---

fix:Ensure the `height` param in `gr.File` works as expected
6 changes: 0 additions & 6 deletions .changeset/new-chefs-build.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/pink-signs-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gradio/lite": minor
"@gradio/wasm": minor
"gradio": minor
---

feat:Lite: Capture stdout and stderr from the main thread
6 changes: 0 additions & 6 deletions .changeset/public-owls-mate.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/real-ads-like.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/file": minor
"gradio": minor
---

feat:Allow reordering files in gr.File
5 changes: 0 additions & 5 deletions .changeset/rotten-drinks-push.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/seven-hands-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"gradio": patch
"gradio_client": patch
---

feat:Update Guides related to deploying Gradio chatbots to Discord, Slack, and website widgets
5 changes: 5 additions & 0 deletions .changeset/slimy-pants-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Allow editable ChatInterface
5 changes: 5 additions & 0 deletions .changeset/thick-dingos-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:gr.load_chat: Allow loading any openai-compatible server immediately as a ChatInterface
5 changes: 5 additions & 0 deletions .changeset/twenty-waves-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fix typing for components in `gr.Interface` and docstring in `image.py`
5 changes: 0 additions & 5 deletions .changeset/two-ghosts-punch.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"gradio": patch
---

feat:Add Japanese translations for login UI
fix:fix: make sure `comp.instance` exists
6 changes: 0 additions & 6 deletions .changeset/wild-guests-make.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wild-sheep-agree.md

This file was deleted.

41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# gradio

## 5.9.1

### Fixes

- [#10212](https://github.com/gradio-app/gradio/pull/10212) [`3d8fc42`](https://github.com/gradio-app/gradio/commit/3d8fc42c94034a29edbc43852937684b478d4667) - Fix render trigger. Thanks @aliabid94!

## 5.9.0

### Features

- [#10196](https://github.com/gradio-app/gradio/pull/10196) [`c9ba9a4`](https://github.com/gradio-app/gradio/commit/c9ba9a447596a9ccdd21955adb3b34b15cac7ade) - Use the modern lower-case Python types in the API typing information. Thanks @abidlabs!
- [#10149](https://github.com/gradio-app/gradio/pull/10149) [`9cd291b`](https://github.com/gradio-app/gradio/commit/9cd291b7f1c37ef0ffd3e8721fb2b648003b50fc) - Resizeable chatbot. Thanks @aliabid94!
- [#10109](https://github.com/gradio-app/gradio/pull/10109) [`48e4aa9`](https://github.com/gradio-app/gradio/commit/48e4aa9d627b6958a0b215d6312de508845f669c) - adds a `run_examples_on_click` parameter to `gr.ChatInterface` mirroring the the `run_on_click` parameter in `gr.Examples`. Thanks @abidlabs!
- [#10135](https://github.com/gradio-app/gradio/pull/10135) [`3e93740`](https://github.com/gradio-app/gradio/commit/3e93740f057712278a7c2194a1702f48915683e1) - Improve pasted text behaviour in `Multimodaltextbox`. Thanks @hannahblair!
- [#10098](https://github.com/gradio-app/gradio/pull/10098) [`9a6ce6f`](https://github.com/gradio-app/gradio/commit/9a6ce6f6b089d94c06da0b8620f28967f39f8383) - Refactor full screen logic to be reusable. Thanks @hannahblair!
- [#10111](https://github.com/gradio-app/gradio/pull/10111) [`3665e81`](https://github.com/gradio-app/gradio/commit/3665e81b53555e2b499b877208686f3027eaceb4) - Allow Chatbot examples to show more than one image. Thanks @hannahblair!
- [#10088](https://github.com/gradio-app/gradio/pull/10088) [`cb5b891`](https://github.com/gradio-app/gradio/commit/cb5b89108e0217131a914315be698827a4d05c15) - Refactor `NO_RELOAD` implementation. Thanks @CNSeniorious000!
- [#10132](https://github.com/gradio-app/gradio/pull/10132) [`6645518`](https://github.com/gradio-app/gradio/commit/6645518a66e01ebcd2746626a4e2a14239172e76) - Tweak Chatbot `bubble_full_width` behaviour. Thanks @hannahblair!
- [#10198](https://github.com/gradio-app/gradio/pull/10198) [`494c4dd`](https://github.com/gradio-app/gradio/commit/494c4ddf6c5ccefe5f5c1bb8dc0671e5b54cd79f) - Add note that SSR mode is experimental. Thanks @abidlabs!
- [#10155](https://github.com/gradio-app/gradio/pull/10155) [`23a2958`](https://github.com/gradio-app/gradio/commit/23a2958f5e2104b4f371915986251e8ea09bd44b) - Add a `.click()` event and `padding` parameter to the `HTML` component. Thanks @abidlabs!
- [#10158](https://github.com/gradio-app/gradio/pull/10158) [`19e1ef5`](https://github.com/gradio-app/gradio/commit/19e1ef52dcd2c7f2bae49ef7844fbfd31c1785fe) - make printing the error message from a `gr.Error` to the console configurable. Thanks @obendidi!
- [#10137](https://github.com/gradio-app/gradio/pull/10137) [`fe7a9db`](https://github.com/gradio-app/gradio/commit/fe7a9db659e009bb5ac0e4e9cb4ac0eab1f2c2f4) - Improve uploaded file UI in Chatbot. Thanks @hannahblair!
- [#10169](https://github.com/gradio-app/gradio/pull/10169) [`25484f4`](https://github.com/gradio-app/gradio/commit/25484f4bfbffdb18850cbd85d4468ea8324afe1a) - By default, consecutive messages are displayed in the same bubble. This is controlled by the new `display_consecutive_in_same_bubble` param of Chatbot. Thanks @freddyaboulton!
- [#10092](https://github.com/gradio-app/gradio/pull/10092) [`20b9d72`](https://github.com/gradio-app/gradio/commit/20b9d72ebb1b962cb34a657cbdad15d003931c6e) - Pass value of `HF_TOKEN` environment variable when loading models with `gr.load`. Thanks @abidlabs!
- [#10166](https://github.com/gradio-app/gradio/pull/10166) [`8ac5b13`](https://github.com/gradio-app/gradio/commit/8ac5b13c96f871ac4b0f13c6ebfbb5559a18bcc2) - Add Japanese translations for login UI. Thanks @kazuhitoyokoi!
- [#10193](https://github.com/gradio-app/gradio/pull/10193) [`424365b`](https://github.com/gradio-app/gradio/commit/424365bdbd0b805e3b2d0c44ccc0f47201b1d96a) - JSON type fix in Client and and typing fix for `/chat` endpoint in `gr.ChatInterface`. Thanks @abidlabs!
- [#10159](https://github.com/gradio-app/gradio/pull/10159) [`7ca3685`](https://github.com/gradio-app/gradio/commit/7ca36850c9e46a1eb5b7a3866b4b166776b4146f) - Add Japanese message into message catalog. Thanks @kazuhitoyokoi!
- [#10188](https://github.com/gradio-app/gradio/pull/10188) [`22fe4ce`](https://github.com/gradio-app/gradio/commit/22fe4ce5a11d7bbdace2fa8e2fd63eccb74f5b07) - Fix `multipart` ModuleNotFoundError by renaming import to `python_multipart`. Thanks @archiloque!

### Fixes

- [#10168](https://github.com/gradio-app/gradio/pull/10168) [`7d70596`](https://github.com/gradio-app/gradio/commit/7d70596d0b3343dc4b357758f85420a0afdb65a2) - Multimodal autofocus fix. Thanks @dawoodkhan82!
- [#10167](https://github.com/gradio-app/gradio/pull/10167) [`5f03649`](https://github.com/gradio-app/gradio/commit/5f03649668856a383066964b60cb14c9cd566140) - Let Gradio be typed!. Thanks @abidlabs!
- [#10185](https://github.com/gradio-app/gradio/pull/10185) [`e525680`](https://github.com/gradio-app/gradio/commit/e52568031633fcecb67276f878382e05c111d258) - Clean up `gr.ChatInterface` and fix API type discrepancy. Thanks @abidlabs!
- [#10131](https://github.com/gradio-app/gradio/pull/10131) [`4984e84`](https://github.com/gradio-app/gradio/commit/4984e847fa2575f9fb209c6b1b73a9003e79e564) - Fix API docs for `multimodal_textbox.py`. Thanks @abidlabs!
- [#10129](https://github.com/gradio-app/gradio/pull/10129) [`2b55302`](https://github.com/gradio-app/gradio/commit/2b5530274af3936c82176f09db529168263acc2c) - Quick Fix: Fixes autoplay parameter for Audio/Video in Chatbot. Thanks @dawoodkhan82!
- [#10190](https://github.com/gradio-app/gradio/pull/10190) [`b4004e3`](https://github.com/gradio-app/gradio/commit/b4004e37ae2e4c61c25012802a9d7aa559a2e690) - Support event + request data in gr.render triggers. Thanks @aliabid94!
- [#10170](https://github.com/gradio-app/gradio/pull/10170) [`5e6e234`](https://github.com/gradio-app/gradio/commit/5e6e234cba820d29ebe29de2597d36ab3683093b) - Custom component in rerender. Thanks @aliabid94!
- [#10161](https://github.com/gradio-app/gradio/pull/10161) [`3a053cc`](https://github.com/gradio-app/gradio/commit/3a053cc76c173c6386e0b5102b03e1a56786cbb9) - Fix chatbot `visible` prop not reacting to changes. Thanks @freddyaboulton!
- [#10097](https://github.com/gradio-app/gradio/pull/10097) [`43d88c3`](https://github.com/gradio-app/gradio/commit/43d88c32bf5f636762acffba839800e05294e484) - Fix: Added support for show_api in mount_gradio_app. Thanks @HongweiRuan!

## 5.8.0

### Features
Expand Down
7 changes: 7 additions & 0 deletions client/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# gradio_client

## 1.5.2

### Features

- [#10196](https://github.com/gradio-app/gradio/pull/10196) [`c9ba9a4`](https://github.com/gradio-app/gradio/commit/c9ba9a447596a9ccdd21955adb3b34b15cac7ade) - Use the modern lower-case Python types in the API typing information. Thanks @abidlabs!
- [#10193](https://github.com/gradio-app/gradio/pull/10193) [`424365b`](https://github.com/gradio-app/gradio/commit/424365bdbd0b805e3b2d0c44ccc0f47201b1d96a) - JSON type fix in Client and and typing fix for `/chat` endpoint in `gr.ChatInterface`. Thanks @abidlabs!

## 1.5.1

### Fixes
Expand Down
7 changes: 7 additions & 0 deletions client/python/gradio_client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# gradio_client

## 1.5.2

### Features

- [#10196](https://github.com/gradio-app/gradio/pull/10196) [`c9ba9a4`](https://github.com/gradio-app/gradio/commit/c9ba9a447596a9ccdd21955adb3b34b15cac7ade) - Use the modern lower-case Python types in the API typing information. Thanks @abidlabs!
- [#10193](https://github.com/gradio-app/gradio/pull/10193) [`424365b`](https://github.com/gradio-app/gradio/commit/424365bdbd0b805e3b2d0c44ccc0f47201b1d96a) - JSON type fix in Client and and typing fix for `/chat` endpoint in `gr.ChatInterface`. Thanks @abidlabs!

## 1.5.1

### Fixes
Expand Down
4 changes: 3 additions & 1 deletion client/python/gradio_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,9 @@ def deploy_discord(
hf_token: HF api token with write priviledges in order to upload the files to HF space. Can be ommitted if logged in via the HuggingFace CLI, unless the upstream space is private. Obtain from: https://huggingface.co/settings/token
private: Whether the space hosting the discord bot is private. The visibility of the discord bot itself is set via the discord website. See https://huggingface.co/spaces/freddyaboulton/test-discord-bot-v1
"""

warnings.warn(
"This method is deprecated and may be removed in the future. Please see the documentation on how to create a discord bot with Gradio: https://www.gradio.app/guides/creating-a-discord-bot-from-a-gradio-app"
)
if self.config["mode"] == "chat_interface" and not api_names:
api_names = [("chat", "chat")]

Expand Down
2 changes: 1 addition & 1 deletion client/python/gradio_client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gradio_client",
"version": "1.5.1",
"version": "1.5.2",
"description": "",
"python": "true",
"main_changeset": true,
Expand Down
12 changes: 7 additions & 5 deletions client/python/gradio_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,11 @@ def get_type(schema: dict):

FILE_DATA_FORMATS = [
"Dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: Dict())",
"dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict())",
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None)",
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None, is_stream: bool)",
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None, is_stream: bool, meta: Dict())",
"dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None, is_stream: bool, meta: dict())",
]

CURRENT_FILE_DATA_FORMAT = FILE_DATA_FORMATS[-1]
Expand All @@ -926,7 +928,7 @@ def _json_schema_to_python_type(schema: Any, defs) -> str:
type_ = get_type(schema)
if type_ == {}:
if "json" in schema.get("description", {}):
return "Dict[Any, Any]"
return "str | float | bool | list | dict"
else:
return "Any"
elif type_ == "$ref":
Expand All @@ -953,15 +955,15 @@ def _json_schema_to_python_type(schema: Any, defs) -> str:
elements = ", ".join(
[_json_schema_to_python_type(i, defs) for i in items["prefixItems"]]
)
return f"Tuple[{elements}]"
return f"tuple[{elements}]"
elif "prefixItems" in schema:
elements = ", ".join(
[_json_schema_to_python_type(i, defs) for i in schema["prefixItems"]]
)
return f"Tuple[{elements}]"
return f"tuple[{elements}]"
else:
elements = _json_schema_to_python_type(items, defs)
return f"List[{elements}]"
return f"list[{elements}]"
elif type_ == "object":

def get_desc(v):
Expand All @@ -980,7 +982,7 @@ def get_desc(v):
f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}"
]
des = ", ".join(des)
return f"Dict({des})"
return f"dict({des})"
elif type_ in ["oneOf", "anyOf"]:
desc = " | ".join([_json_schema_to_python_type(i, defs) for i in schema[type_]])
return desc
Expand Down
10 changes: 5 additions & 5 deletions client/python/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def test_numerical_to_label_space(self):
"label": "output",
"type": {"type": {}, "description": "any valid json"},
"python_type": {
"type": "Dict[Any, Any]",
"type": "dict[Any, Any]",
"description": "any valid json",
},
"component": "Label",
Expand Down Expand Up @@ -954,7 +954,7 @@ def test_numerical_to_label_space(self):
"label": "output",
"type": {"type": {}, "description": "any valid json"},
"python_type": {
"type": "Dict[Any, Any]",
"type": "dict[Any, Any]",
"description": "any valid json",
},
"component": "Label",
Expand Down Expand Up @@ -994,7 +994,7 @@ def test_numerical_to_label_space(self):
"label": "output",
"type": {"type": {}, "description": "any valid json"},
"python_type": {
"type": "Dict[Any, Any]",
"type": "dict[Any, Any]",
"description": "any valid json",
},
"component": "Label",
Expand Down Expand Up @@ -1130,15 +1130,15 @@ def test_file_io(self, file_io_demo):
outputs = info["named_endpoints"]["/predict"]["returns"]

assert inputs[0]["type"]["type"] == "array"
assert inputs[0]["python_type"]["type"] == "List[filepath]"
assert inputs[0]["python_type"]["type"] == "list[filepath]"

assert isinstance(inputs[0]["example_input"], list)
assert isinstance(inputs[0]["example_input"][0], dict)

assert inputs[1]["python_type"]["type"] == "filepath"
assert isinstance(inputs[1]["example_input"], dict)

assert outputs[0]["python_type"]["type"] == "List[filepath]"
assert outputs[0]["python_type"]["type"] == "list[filepath]"
assert outputs[0]["type"]["type"] == "array"

assert outputs[1]["python_type"]["type"] == "filepath"
Expand Down
Loading

0 comments on commit d8d64bc

Please sign in to comment.