Simplest possible gradio app
Browse files
app.py
CHANGED
|
@@ -1,23 +1,8 @@
|
|
| 1 |
-
"""
|
| 2 |
-
StackNet Demo - Minimal test version
|
| 3 |
-
"""
|
| 4 |
-
|
| 5 |
import gradio as gr
|
| 6 |
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 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 |
-
|
| 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()
|
|
|