MitchellKil commited on
Commit
37131e6
·
verified ·
1 Parent(s): 9607a53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -22,7 +22,7 @@ class TTSRequest(BaseModel):
22
  #
23
  @app.get("/")
24
  def root():
25
- return {"message": "Health check, Gaelic TTS running. POST /predict for TTS."}
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
- ) # Due to no support using Celtic (Welsh) model as "experimental" audio
43
  audio_bytes = response["AudioStream"].read()
44
  return {"audio_base64": base64.b64encode(audio_bytes).decode("utf-8")}
45
 
46
- @app.post("/predict") # Actual call to run and retrieve polly using my IPA and text
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)