HusseinBashir commited on
Commit
528f1a0
·
verified ·
1 Parent(s): 8a1bc2f

Delete main.py

Browse files
Files changed (1) hide show
  1. main.py +0 -18
main.py DELETED
@@ -1,18 +0,0 @@
1
- from fastapi import FastAPI, Request
2
- from fastapi.responses import JSONResponse
3
- from gradio_client import Client
4
-
5
- app = FastAPI()
6
- client = Client("HusseinBashir/Somali_tts")
7
-
8
- @app.post("/somali-tts/")
9
- async def somali_tts(request: Request):
10
- data = await request.json()
11
- text = data.get("text")
12
- if not text:
13
- return JSONResponse(content={"error": "No text provided"}, status_code=400)
14
- try:
15
- audio_url = client.predict(text, api_name="/predict")
16
- return JSONResponse(content={"audio_url": audio_url})
17
- except Exception as e:
18
- return JSONResponse(content={"error": str(e)}, status_code=500)