Ensure gradio_client is backwards compatible with gradio==3.24.1 (#5061)

* fix to client

* add changeset

* lint

* add changeset

* add changeset

* add changeset

* add changeset

* pin

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Abubakar Abid 2023-08-02 18:06:25 -04:00 committed by GitHub
parent 7d89716519
commit 136adc9ccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"gradio": patch
"gradio_client": patch
---
fix:Ensure `gradio_client` is backwards compatible with `gradio==3.24.1`

View File

@ -38,12 +38,14 @@ class Serializable:
# For backwards compatibility
def input_api_info(self) -> tuple[str, str]:
api_info = self.api_info()
return (api_info["serialized_input"][0], api_info["serialized_input"][1])
types = api_info.get("serialized_input", [api_info["info"]["type"]] * 2) # type: ignore
return (types[0], types[1])
# For backwards compatibility
def output_api_info(self) -> tuple[str, str]:
api_info = self.api_info()
return (api_info["serialized_output"][0], api_info["serialized_output"][1])
types = api_info.get("serialized_output", [api_info["info"]["type"]] * 2) # type: ignore
return (types[0], types[1])
def serialize(self, x: Any, load_dir: str | Path = ""):
"""

View File

@ -3,7 +3,7 @@ aiohttp~=3.0
altair>=4.2.0,<6.0
fastapi
ffmpy
gradio_client>=0.3.0
gradio_client==0.3.0
httpx
huggingface_hub>=0.14.0
importlib_resources>=1.3,<7.0