Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flagging does not handle files correctly #7701

Closed
1 task done
abidlabs opened this issue Mar 14, 2024 · 0 comments · Fixed by #7704
Closed
1 task done

Flagging does not handle files correctly #7701

abidlabs opened this issue Mar 14, 2024 · 0 comments · Fixed by #7704
Labels
bug Something isn't working

Comments

@abidlabs
Copy link
Member

Describe the bug

When a Gradio Interface that contains file-based components is flagged, files are not saved as filepaths, rather the entire FileData dictionary is saved, e.g.

x,y,output 0,output 1,flag,username,timestamp
abc,"{""path"":""flagged/y/ee116ed9c7acc9a98c59/001.jpg"",""url"":""http://127.0.0.1:7860/file=/private/var/folders/kf/ll6fqkys7_s05x4tvb546mdc0000gn/T/gradio/30051634f345dc47162df9144c44b3f68647ee97/001.jpg"",""size"":319979,""orig_name"":""001.jpg"",""mime_type"":""image/jpeg"",""is_stream"":false,""meta"":{""_type"":""gradio.FileData""}}",abc,"{""path"":""flagged/output 1/bbe052c0d4955425f70d/image.png"",""url"":""http://127.0.0.1:7860/file=/private/var/folders/kf/ll6fqkys7_s05x4tvb546mdc0000gn/T/gradio/eef3453ead8c83d394ce7ade4d0eb4b754dbb5b5/image.png"",""size"":null,""orig_name"":""image.png"",""mime_type"":null,""is_stream"":false,""meta"":{""_type"":""gradio.FileData""}}",,,2024-03-13 21:24:47.604304

which makes it very hard to parse

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

gr.Interface(lambda x,y:(x,y), ["textbox", "image"], ["textbox", "image"], allow_flagging="auto").launch()

Screenshot

No response

Logs

No response

System Info

4.21

Severity

I can work around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant