File size: 896 Bytes
6c7a215
2c2797b
34eb043
903b6b9
749138f
26349dc
749138f
903b6b9
 
 
 
f9bd500
749138f
903b6b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e8f20a0
903b6b9
e8f20a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import gradio as gr
from gradio_client import Client


DEBUG_MODE = True


def update(name):
    #return f"Welcome to Gradio, {name}!"
    return {"name": name}



with gr.Blocks() as demo:
    
    with gr.Row():
        gr.Markdown("Start typing below and then click **Run** to see the output.")
        #gr.DuplicateButton()
    with gr.Row():
        with gr.Col():
            gr.Markdown("Type your message:")
            inp = gr.Textbox(placeholder="What is your name?")
        with gr.Col():
          out = gr.JSON()  
    btn = gr.Button("Send request to server")
    btn.click(fn=update, inputs=inp, outputs=out)
            
    #with gr.Row():
        #inp = gr.Textbox(placeholder="What is your name?")
        #out = gr.JSON()
        #out = gr.Textbox()
    #btn = gr.Button("Run")
    #btn.click(fn=update, inputs=inp, outputs=out    
    
    
        
demo.launch(share=True)