Spaces:
Sleeping
Sleeping
Add root endpoint for UI
Browse files
app.py
CHANGED
|
@@ -62,6 +62,10 @@ async def remove_file(path: Path):
|
|
| 62 |
except Exception as e:
|
| 63 |
logging.error(f"Failed to delete {path}: {e}")
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
@app.post("/generate", summary="Generate TTS Audio from Text")
|
| 66 |
async def generate_audio(request: TTSRequest, background_tasks: BackgroundTasks):
|
| 67 |
if not request.text.strip():
|
|
|
|
| 62 |
except Exception as e:
|
| 63 |
logging.error(f"Failed to delete {path}: {e}")
|
| 64 |
|
| 65 |
+
@app.get("/", summary="Health Check")
|
| 66 |
+
async def root():
|
| 67 |
+
return {"status": "success", "message": "TTS API is running perfectly on Hugging Face Spaces!", "endpoints": ["POST /generate"]}
|
| 68 |
+
|
| 69 |
@app.post("/generate", summary="Generate TTS Audio from Text")
|
| 70 |
async def generate_audio(request: TTSRequest, background_tasks: BackgroundTasks):
|
| 71 |
if not request.text.strip():
|