Spaces:
Runtime error
Runtime error
Calvin commited on
Commit ·
8eb87d6
1
Parent(s): c38128a
fix runtime
Browse files- app.py → main.py +6 -1
- requirements.txt +1 -1
app.py → main.py
RENAMED
|
@@ -102,4 +102,9 @@ async def api_tts_url(req: TTSRequest):
|
|
| 102 |
res = await api_tts(req)
|
| 103 |
# We can't easily return a hosted URL without external storage.
|
| 104 |
# So return error telling user to use /api/tts which streams audio.
|
| 105 |
-
return JSONResponse({"error": "This Space does not host persistent URLs. Use /api/tts to stream audio."}, status_code=400)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
res = await api_tts(req)
|
| 103 |
# We can't easily return a hosted URL without external storage.
|
| 104 |
# So return error telling user to use /api/tts which streams audio.
|
| 105 |
+
return JSONResponse({"error": "This Space does not host persistent URLs. Use /api/tts to stream audio."}, status_code=400)
|
| 106 |
+
|
| 107 |
+
import uvicorn
|
| 108 |
+
|
| 109 |
+
if __name__ == "__main__":
|
| 110 |
+
uvicorn.run("main:app", host="0.0.0.0", port=7860)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
fastapi
|
| 2 |
-
uvicorn
|
| 3 |
gTTS
|
| 4 |
aiofiles
|
| 5 |
pydantic
|
|
|
|
| 1 |
fastapi
|
| 2 |
+
uvicorn[standard]
|
| 3 |
gTTS
|
| 4 |
aiofiles
|
| 5 |
pydantic
|