Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def advanced_greet(name, is_morning):
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
today = datetime.today().strftime('%d-%m-%Y')
|
| 6 |
+
start_message = "Good morning" if is_morning else "Good evening"
|
| 7 |
+
greetings = f"{start_message} {name}."
|
| 8 |
+
today_message = f"Today is {today}."
|
| 9 |
+
return greetings, today_message
|
| 10 |
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=advanced_greet,
|
| 13 |
+
inputs=["text", "checkbox"],
|
| 14 |
+
outputs=["text", "text"],
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
demo.launch()
|