How can I configure my Gradio web UI so that each Gradio block can be moved around in the UI by the user via drag and drop?

41 Views Asked by At

Example: I have the following Gradio UI:

import gradio as gr

def dummy(a):
    return 'hello', {'hell': 'o'}

with gr.Blocks() as demo:
    txt = gr.Textbox(value="test", label="Query", lines=1)
    txt2 = gr.Textbox(value="test2", label="Query2", lines=1)
    txt3 = gr.Textbox(value="test3", label="Query3", lines=1)
    txt4 = gr.Textbox(value="test4", label="Query4", lines=1)
    answer = gr.Textbox(value="", label="Answer")
    answerjson = gr.JSON()
    btn = gr.Button(value="Submit")
    btn.click(dummy, inputs=[txt], outputs=[answer, answerjson])
    gr.ClearButton([answer, answerjson])

demo.launch()

enter image description here

How can I configure my Gradio web UI so that each block can be moved in the UI by the user via drag and drop?

0

There are 0 best solutions below