Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ class TTSRequest(BaseModel):
|
|
| 22 |
#
|
| 23 |
@app.get("/")
|
| 24 |
def root():
|
| 25 |
-
return {"
|
| 26 |
|
| 27 |
# using mix of Gaelic text and IPA
|
| 28 |
def generate_tts(request: TTSRequest):
|
|
@@ -39,10 +39,10 @@ def generate_tts(request: TTSRequest):
|
|
| 39 |
OutputFormat="mp3",
|
| 40 |
VoiceId="Gwyneth",
|
| 41 |
Engine="standard"
|
| 42 |
-
) #
|
| 43 |
audio_bytes = response["AudioStream"].read()
|
| 44 |
return {"audio_base64": base64.b64encode(audio_bytes).decode("utf-8")}
|
| 45 |
|
| 46 |
-
@app.post("/predict") #
|
| 47 |
def predict(request: TTSRequest):
|
| 48 |
return generate_tts(request)
|
|
|
|
| 22 |
#
|
| 23 |
@app.get("/")
|
| 24 |
def root():
|
| 25 |
+
return {"status": "okay"}
|
| 26 |
|
| 27 |
# using mix of Gaelic text and IPA
|
| 28 |
def generate_tts(request: TTSRequest):
|
|
|
|
| 39 |
OutputFormat="mp3",
|
| 40 |
VoiceId="Gwyneth",
|
| 41 |
Engine="standard"
|
| 42 |
+
) # welsh model
|
| 43 |
audio_bytes = response["AudioStream"].read()
|
| 44 |
return {"audio_base64": base64.b64encode(audio_bytes).decode("utf-8")}
|
| 45 |
|
| 46 |
+
@app.post("/predict") # call
|
| 47 |
def predict(request: TTSRequest):
|
| 48 |
return generate_tts(request)
|