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

MultimodalTextbox - file_types seems not to be working? #8801

Closed
1 task done
skye0402 opened this issue Jul 16, 2024 · 9 comments · Fixed by #9393
Closed
1 task done

MultimodalTextbox - file_types seems not to be working? #8801

skye0402 opened this issue Jul 16, 2024 · 9 comments · Fixed by #9393
Assignees
Labels
bug Something isn't working
Milestone

Comments

@skye0402
Copy link

skye0402 commented Jul 16, 2024

Describe the bug

I'm using the MultimodalTextbox but found that users upload PDF files to it, which makes no sense for my case. The setting for file_types= is on "images" but seems to have no effect. I would expect that you can't upload such files, but e.g. .pdf or .pptx works. Similar behaviour like it is for the upload button and such would be appreciated.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
from gradio.blocks import Blocks


def test()->Blocks:
    with gr.Blocks() as test:
        with gr.Row(elem_id="input_row") as input_row:
            msg_box = gr.MultimodalTextbox(
                interactive=True, 
                file_types=["images"],
                file_count="multiple",
                scale=9,
                elem_id="msg_box",
                show_label=False,
                max_lines=5,
                placeholder="Enter text or images and text and press ENTER",
                container=False,
                info="This is just some info",
                autofocus=True
            )
    return test

blocks = test()
blocks.launch()
    

Screenshot

No response

Logs

No response

System Info

Linux
Gradio Version: 4.38.1

Severity

I can work around it

@skye0402 skye0402 added the bug Something isn't working label Jul 16, 2024
@abidlabs
Copy link
Member

Cc @dawoodkhan82 i think it makes sense to refactor the logic in the frontend so it’s shared across all file components as we’ve heard various issues like this

@abidlabs abidlabs added this to the Gradio 5️⃣ milestone Jul 16, 2024
@peilongchencc
Copy link

I encountered the same issue and look forward to a solution.🥹

@zm0n3
Copy link

zm0n3 commented Aug 28, 2024

This bug is still present in version 4.42.0.

@Rijgersberg
Copy link

Same problem when using the MultimodalTextbox in a ChatInterface

@freddyaboulton
Copy link
Collaborator

This sounds like the same problem as #9098 ?

Are you all using windows?

@skye0402
Copy link
Author

This sounds like the same problem as #9098 ?

Are you all using windows?

Windows as OS to access Gradio, Linux running Gradio.

@abidlabs
Copy link
Member

Closed via #9393

@abidlabs
Copy link
Member

@freddyaboulton this is not the same as the windows issue. The windows issue prevented users from being able to remove the default file type filter (e.g. from "images" to "all files" -- which requires a fix in the backend to prevent users from being able to submit invalid files). In this case for MultimodalTextbox, the file type filter was not working at all, but its been fixed by @dawoodkhan82 in #9393

@dawoodkhan82
Copy link
Collaborator

@skye0402 Your example demo should work as expected now. Just note that you need to provide image not images in the file_type

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
Development

Successfully merging a pull request may close this issue.

7 participants