EmadSalem commited on
Commit
9e31ae4
1 Parent(s): 6dcb5e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -39,9 +39,10 @@ def chat_hf(audio, custom_token, language):
39
  gpt_response = resp['message']
40
 
41
  # to voice
 
 
42
 
43
-
44
- return whisper_text, gpt_response
45
 
46
  # whisper
47
  def translate(audio):
@@ -76,7 +77,7 @@ with gr.Blocks() as blocks:
76
  with gr.Row(equal_height=True):# equal_height=False
77
  with gr.Column():# variant="panel"
78
  radio = gr.Radio(
79
- label="Language",
80
  choices=LANGUAGES,
81
  value=default_lang
82
  )
 
39
  gpt_response = resp['message']
40
 
41
  # to voice
42
+ with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
43
+ coquiTTS.get_tts(gpt_response, fp, speaker = {"language" : language})
44
 
45
+ return whisper_text, gpt_response, fp.name
 
46
 
47
  # whisper
48
  def translate(audio):
 
77
  with gr.Row(equal_height=True):# equal_height=False
78
  with gr.Column():# variant="panel"
79
  radio = gr.Radio(
80
+ label="اللغة",
81
  choices=LANGUAGES,
82
  value=default_lang
83
  )