Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .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`
6 changes: 4 additions & 2 deletions client/python/gradio_client/serializing.py
Expand Up @@ -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 = ""):
"""
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -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
Expand Down