Make detection of files in gradio_client.Client
more robust
#7360
Labels
gradio_client
Related to the one of the gradio client libraries
needs designing
The proposed feature needs to be discussed and designed before being implemented
python
Backend-related issue (Python)
Milestone
The
gradio_client.Client
accepts string filepaths which are converted to file objects and uploaded to the server if they correspond to an input component that accepts files. However, this detection is not very robust.Specifically, if any part of the input component payload can be a file, all parts of the payload are treated as potentially containing files. This leads to issues such as this:
This produces an error because the
""
in theinitial_history
is treated as a potential file and is tried to be uploaded to the server. We should really validate against the API info to figure out which part of the payload could be a file and which format it needs to be in. We should only upload those files, from a security and robustness perspective. Or we need to think of something else altogetherThe text was updated successfully, but these errors were encountered: