Spaces:
Runtime error
Runtime error
import gradio as gr | |
from gradio_textwithattachments import TextWithAttachments | |
from gradio_textwithattachments.textwithattachments import TextWithAttachmentsData | |
with gr.Blocks() as demo: | |
with gr.Row(): | |
with gr.Column(): | |
text = TextWithAttachments() | |
with gr.Column(): | |
with gr.Row(): | |
message = gr.Textbox() | |
files = gr.Files(file_count="multiple") | |
with gr.Row(): | |
json_outout = gr.JSON() | |
def update(data: TextWithAttachmentsData): | |
return data.text, [f.name for f in data.attachments], data | |
demo.launch() | |