Skip to content

Commit

Permalink
Fix Serializer Mapping (#3722)
Browse files Browse the repository at this point in the history
* Fix mapping and test

* Bump gradio version

* Revert gradio version bump
  • Loading branch information
freddyaboulton authored Apr 1, 2023
1 parent ae6b49a commit da7d1df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/python/gradio_client/serializing.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def deserialize(


SERIALIZER_MAPPING = {cls.__name__: cls for cls in Serializable.__subclasses__()}
SERIALIZER_MAPPING["Serializable"] = SimpleSerializable

COMPONENT_MAPPING: Dict[str, type] = {
"textbox": StringSerializable,
Expand Down
2 changes: 1 addition & 1 deletion client/python/gradio_client/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.5
0.0.6
8 changes: 8 additions & 0 deletions client/python/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

from gradio_client import Client
from gradio_client.serializing import SimpleSerializable
from gradio_client.utils import Communicator, Status, StatusUpdate

os.environ["HF_HUB_DISABLE_TELEMETRY"] = "1"
Expand Down Expand Up @@ -254,6 +255,13 @@ def test_numerical_to_label_space(self):
"unnamed_endpoints": {},
}

@pytest.mark.flaky
def test_serializable_in_mapping(self):
client = Client("freddyaboulton/calculator")
assert all(
[c.__class__ == SimpleSerializable for c in client.endpoints[0].serializers]
)

@pytest.mark.flaky
def test_private_space(self):
client = Client("gradio-tests/not-actually-private-space", hf_token=HF_TOKEN)
Expand Down

0 comments on commit da7d1df

Please sign in to comment.