Spaces:
Running
Running
File size: 741 Bytes
707291b 17e2f40 707291b 17e2f40 41e4cda ede846e 41e4cda 437b70e 989c6d5 f150a4a 41e4cda 437b70e f150a4a 437b70e |
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 |
import subprocess
package_name = "torchgeometry"
subprocess.check_call(["pip", "install", package_name])
import gradio as gr
import torchgeometry as tgm
def greet(name, user_name):
user_name += name
return "Hello " + user_name + "!!", user_name
with gr.Blocks() as demo:
user_name = gr.State(value='')
name_input = gr.Textbox(visible = True,lines=1, label='Name input')
name_output = gr.Textbox(visible = True,lines=1, label='Name output')
btn = gr.Button(value="Send")
btn.click(greet, inputs = [name_input, user_name], outputs=[name_output,user_name])
demo.queue()
demo.launch() # server_port=7832, share=True
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# iface.launch(app=app) |