Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Oct 8, 2024
1 parent 848e609 commit fdb070f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
1 change: 1 addition & 0 deletions client/python/gradio_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ def get_type(schema: dict):
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None)",
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None, is_stream: bool)",
"Dict(path: str, url: str | None, size: int | None, orig_name: str | None, mime_type: str | None, is_stream: bool, meta: Dict())",
"Dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: Dict())",
]

CURRENT_FILE_DATA_FORMAT = FILE_DATA_FORMATS[-1]
Expand Down
21 changes: 5 additions & 16 deletions client/python/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,29 +1130,18 @@ def test_file_io(self, file_io_demo):
outputs = info["named_endpoints"]["/predict"]["returns"]

assert inputs[0]["type"]["type"] == "array"
assert inputs[0]["python_type"] == {
"type": "List[filepath]",
"description": "",
}
assert inputs[0]["python_type"]["type"] == "List[filepath]"

assert isinstance(inputs[0]["example_input"], list)
assert isinstance(inputs[0]["example_input"][0], dict)

assert inputs[1]["python_type"] == {
"type": "filepath",
"description": "",
}
assert inputs[1]["python_type"]["type"] == "filepath"
assert isinstance(inputs[1]["example_input"], dict)

assert outputs[0]["python_type"] == {
"type": "List[filepath]",
"description": "",
}
assert outputs[0]["python_type"]["type"] == "List[filepath]"
assert outputs[0]["type"]["type"] == "array"

assert outputs[1]["python_type"] == {
"type": "filepath",
"description": "",
}
assert outputs[1]["python_type"]["type"] == "filepath"

def test_layout_components_in_output(self, hello_world_with_group):
with connect(hello_world_with_group) as client:
Expand Down

0 comments on commit fdb070f

Please sign in to comment.