hwonder commited on
Commit
a5df311
·
1 Parent(s): 8ae30de

Simplest possible gradio app

Browse files
Files changed (1) hide show
  1. app.py +4 -19
app.py CHANGED
@@ -1,23 +1,8 @@
1
- """
2
- StackNet Demo - Minimal test version
3
- """
4
-
5
  import gradio as gr
6
 
 
 
7
 
8
- def test_function(text):
9
- return f"You entered: {text}"
10
-
11
-
12
- with gr.Blocks(title="StackNet Demo") as demo:
13
- gr.Markdown("# StackNet Demo 1:1 Preview - Test")
14
-
15
- with gr.Row():
16
- input_text = gr.Textbox(label="Input")
17
- output_text = gr.Textbox(label="Output")
18
-
19
- btn = gr.Button("Test")
20
- btn.click(fn=test_function, inputs=[input_text], outputs=[output_text])
21
 
22
- if __name__ == "__main__":
23
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ def greet(name):
4
+ return "Hello " + name + "!"
5
 
6
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ demo.launch()