Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ model = T5ForConditionalGeneration.from_pretrained(MODEL_NAME)
|
|
| 10 |
print("Model loaded!")
|
| 11 |
|
| 12 |
|
| 13 |
-
@app.
|
| 14 |
def translate(text, prompt):
|
| 15 |
"""
|
| 16 |
Translate text using T5 with a task prefix.
|
|
@@ -43,8 +43,6 @@ app = Server(
|
|
| 43 |
version="1.0.0",
|
| 44 |
)
|
| 45 |
|
| 46 |
-
# Register as Gradio API endpoints (queued, SSE-streaming capable)
|
| 47 |
-
app.api(translate, name="translate") # POST /gradio_api/call/translate
|
| 48 |
|
| 49 |
# Optional: plain FastAPI GET health-check route
|
| 50 |
@app.get("/health")
|
|
|
|
| 10 |
print("Model loaded!")
|
| 11 |
|
| 12 |
|
| 13 |
+
@app.api(name="translate")
|
| 14 |
def translate(text, prompt):
|
| 15 |
"""
|
| 16 |
Translate text using T5 with a task prefix.
|
|
|
|
| 43 |
version="1.0.0",
|
| 44 |
)
|
| 45 |
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Optional: plain FastAPI GET health-check route
|
| 48 |
@app.get("/health")
|