Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This is a simple Gradio app that greets the user.
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# Define a function that takes a name and returns a greeting.
|
| 5 |
+
def greet(name):
|
| 6 |
+
return "Hello " + name + "!"
|
| 7 |
+
|
| 8 |
+
# Create a Gradio interface that takes a textbox input, runs it through the greet function, and returns output to a textbox.
|
| 9 |
+
demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
|
| 10 |
+
|
| 11 |
+
# Launch the interface.
|
| 12 |
+
if __name__ == "__main__":
|
| 13 |
+
demo.launch(show_error=True)
|