salomonsky commited on
Commit
a647243
·
verified ·
1 Parent(s): 1118eaf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,7 +25,7 @@ def format_prompt(message, history):
25
  prompt += f"[INST] {message} [/INST]"
26
  return prompt
27
 
28
- def text_to_speech(text, speed=2.0):
29
  tts = gTTS(text=text, lang='es')
30
  audio_file_path = 'output.mp3'
31
  tts.save(audio_file_path)
@@ -62,7 +62,7 @@ def generate(user_input, history, temperature=None, max_new_tokens=2048, top_p=0
62
 
63
  response = ' '.join(response.split()).replace('</s>', '')
64
 
65
- audio_file_path = text_to_speech(response, speed=2.0)
66
  audio_file = open(audio_file_path, 'rb')
67
  audio_bytes = audio_file.read()
68
 
 
25
  prompt += f"[INST] {message} [/INST]"
26
  return prompt
27
 
28
+ def text_to_speech(text):
29
  tts = gTTS(text=text, lang='es')
30
  audio_file_path = 'output.mp3'
31
  tts.save(audio_file_path)
 
62
 
63
  response = ' '.join(response.split()).replace('</s>', '')
64
 
65
+ audio_file_path = text_to_speech(response, speed=1.3)
66
  audio_file = open(audio_file_path, 'rb')
67
  audio_bytes = audio_file.read()
68