add application file
Browse files
app.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def greet(name):
|
| 4 |
+
return f"Hello {name}!"
|
| 5 |
+
|
| 6 |
+
demo = gr.Interface(
|
| 7 |
+
fn=greet,
|
| 8 |
+
inputs=gr.Textbox(placeholder="Enter your name"),
|
| 9 |
+
outputs="text",
|
| 10 |
+
title="Greeting App",
|
| 11 |
+
description="A simple app to greet users.",
|
| 12 |
+
theme="default",
|
| 13 |
+
allow_flagging="never",
|
| 14 |
+
allow_screenshot=False,
|
| 15 |
+
css="""
|
| 16 |
+
body {
|
| 17 |
+
background-color: #f0f0f0;
|
| 18 |
+
}
|
| 19 |
+
.gradio-container {
|
| 20 |
+
font-family: Arial, sans-serif;
|
| 21 |
+
}
|
| 22 |
+
.gr-button {
|
| 23 |
+
background-color: #007bff;
|
| 24 |
+
color: white;
|
| 25 |
+
}
|
| 26 |
+
.gr-button:hover {
|
| 27 |
+
background-color: #0056b3;
|
| 28 |
+
}
|
| 29 |
+
.gr-textbox {
|
| 30 |
+
border: 2px solid #007bff;
|
| 31 |
+
border-radius: 5px;
|
| 32 |
+
}
|
| 33 |
+
.gr-textbox:focus {
|
| 34 |
+
border-color: #0056b3;
|
| 35 |
+
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
| 36 |
+
}
|
| 37 |
+
"""
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
demo.launch()
|