Skip to content

Commit

Permalink
Ensure gradio_client is backwards compatible with gradio==3.24.1 (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
abidlabs and gradio-pr-bot committed Aug 2, 2023
1 parent 7d89716 commit 136adc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
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

1 comment on commit 136adc9

@vercel
Copy link

@vercel vercel bot commented on 136adc9 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.