mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Fix video serializing in client (#3860)
* Fix video serializing in client * Add to changelog * Remove print
This commit is contained in:
parent
1b4925712b
commit
7ef0439d3c
@ -6,7 +6,7 @@ No changes to highlight.
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
No changes to highlight.
|
||||
- Fixed bug where `Video` components in latest gradio were not able to be deserialized by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3860](https://github.com/gradio-app/gradio/pull/3860)
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
|
@ -368,7 +368,7 @@ class VideoSerializable(FileSerializable):
|
||||
Convert from serialized representation of a file (base64) to a human-friendly
|
||||
version (string filepath). Optionally, save the file to the directory specified by `save_dir`
|
||||
"""
|
||||
if isinstance(x, tuple):
|
||||
if isinstance(x, (tuple, list)):
|
||||
assert len(x) == 2, f"Expected tuple of length 2. Received: {x}"
|
||||
x_as_list = [x[0], x[1]]
|
||||
else:
|
||||
@ -501,7 +501,12 @@ class GallerySerializable(Serializable):
|
||||
return os.path.abspath(gallery_path)
|
||||
|
||||
|
||||
SERIALIZER_MAPPING = {cls.__name__: cls for cls in Serializable.__subclasses__()}
|
||||
SERIALIZER_MAPPING = {}
|
||||
for cls in Serializable.__subclasses__():
|
||||
SERIALIZER_MAPPING[cls.__name__] = cls
|
||||
for subcls in cls.__subclasses__():
|
||||
SERIALIZER_MAPPING[subcls.__name__] = subcls
|
||||
|
||||
SERIALIZER_MAPPING["Serializable"] = SimpleSerializable
|
||||
SERIALIZER_MAPPING["File"] = FileSerializable
|
||||
SERIALIZER_MAPPING["UploadButton"] = FileSerializable
|
||||
|
Loading…
Reference in New Issue
Block a user