File size: 427 Bytes
770f5f7
 
cd53d09
f6b67f5
 
cd53d09
2a9567a
f6b67f5
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os
import gradio as gr

def sum(a, b):
    return str(float(a) + float(b))

with gr.Blocks() as demo:
    input_a = gr.Textbox(label = 'Value 1', value = '0')
    input_b = gr.Textbox(label = 'Value 2', value = '0')
    result_box = gr.Textbox(label = 'Result', value = '0')
    button_go = gr.Button(value = 'GO')
    button_go.click(fn=sum, inputs = [input_a, input_b], outputs = result_box)
demo.launch(share = True)