Spaces:
Runtime error
Runtime error
test deploy
Browse files
app.py
CHANGED
|
@@ -1,17 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
from fastapi import FastAPI
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
print("✅ Space is live!")
|
| 9 |
|
| 10 |
-
|
| 11 |
-
def ping():
|
| 12 |
-
return {"ping": "pong"}
|
| 13 |
-
|
| 14 |
-
@app.post("/predict")
|
| 15 |
-
def predict(payload: dict):
|
| 16 |
-
# Echo back whatever JSON you send
|
| 17 |
-
return {"received": payload}
|
|
|
|
| 1 |
+
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
+
def add(x, y):
|
| 4 |
+
return x + y
|
| 5 |
|
| 6 |
+
# Interface: define inputs and outputs
|
| 7 |
+
app = gr.Interface(fn=add, inputs=["number", "number"], outputs="number")
|
|
|
|
| 8 |
|
| 9 |
+
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|