diff --git a/.changeset/tired-regions-punch.md b/.changeset/tired-regions-punch.md new file mode 100644 index 000000000000..4c6afed0e503 --- /dev/null +++ b/.changeset/tired-regions-punch.md @@ -0,0 +1,6 @@ +--- +"gradio": patch +"gradio_client": patch +--- + +fix:Ensure `gradio_client` is backwards compatible with `gradio==3.24.1` diff --git a/client/python/gradio_client/serializing.py b/client/python/gradio_client/serializing.py index 6a4315f6bffc..a5fb3c908086 100644 --- a/client/python/gradio_client/serializing.py +++ b/client/python/gradio_client/serializing.py @@ -38,12 +38,14 @@ def example_inputs(self) -> dict[str, Any]: # 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 = ""): """ diff --git a/requirements.txt b/requirements.txt index 33416024193c..dc18969df2da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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