Spaces:
Running
Running
Add debug endpoint
Browse files- app/main.py +9 -0
app/main.py
CHANGED
|
@@ -254,6 +254,15 @@ async def serve_ui():
|
|
| 254 |
return HTMLResponse(ui_path.read_text())
|
| 255 |
return HTMLResponse("<h1>Speaker Diarization API</h1><p><a href='/docs'>API Docs →</a></p>")
|
| 256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
|
| 258 |
static_dir = Path("static")
|
| 259 |
if static_dir.exists():
|
|
|
|
| 254 |
return HTMLResponse(ui_path.read_text())
|
| 255 |
return HTMLResponse("<h1>Speaker Diarization API</h1><p><a href='/docs'>API Docs →</a></p>")
|
| 256 |
|
| 257 |
+
@app.get("/debug", tags=["System"])
|
| 258 |
+
async def debug():
|
| 259 |
+
import speechbrain
|
| 260 |
+
import os
|
| 261 |
+
return {
|
| 262 |
+
"speechbrain_version": speechbrain.__version__,
|
| 263 |
+
"tmp_writable": os.access("/tmp", os.W_OK),
|
| 264 |
+
"cache_exists": os.path.exists("/tmp/model_cache"),
|
| 265 |
+
}
|
| 266 |
|
| 267 |
static_dir = Path("static")
|
| 268 |
if static_dir.exists():
|