Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AI-Assisted Code — Academic Integrity Notice
|
| 2 |
+
# Generated with The App Builder. ESCP coursework.
|
| 3 |
+
# Student must be able to explain all code when asked.
|
| 4 |
+
|
| 5 |
+
import gradio as gr
|
| 6 |
+
|
| 7 |
+
def greet(name):
|
| 8 |
+
"""Return a greeting message."""
|
| 9 |
+
if not name.strip():
|
| 10 |
+
return "Please enter your name."
|
| 11 |
+
return f"Hello {name}, your HF app works!"
|
| 12 |
+
|
| 13 |
+
demo = gr.Interface(
|
| 14 |
+
fn=greet,
|
| 15 |
+
inputs=gr.Textbox(label="Your name"),
|
| 16 |
+
outputs=gr.Textbox(label="Output"),
|
| 17 |
+
title="My First Hugging Face App",
|
| 18 |
+
description="A basic Gradio app deployed on Hugging Face Spaces."
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
demo.launch()
|