gradio/demo/hello_world_2/run.py

15 lines
273 B
Python
Raw Normal View History

2021-05-24 23:31:44 +08:00
import gradio as gr
2022-02-09 02:56:13 +08:00
2021-05-24 23:31:44 +08:00
def greet(name):
return "Hello " + name + "!"
2022-02-09 02:56:13 +08:00
2021-05-24 23:31:44 +08:00
iface = gr.Interface(
fn=greet,
inputs=gr.inputs.Textbox(lines=2, placeholder="Name Here..."),
outputs="text",
)
2021-05-24 23:31:44 +08:00
if __name__ == "__main__":
2022-03-01 01:04:09 +08:00
app, local_url, share_url = iface.launch()