ylacombe HF staff commited on
Commit
83298a1
1 Parent(s): c534b30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -80,13 +80,6 @@ text_client = InferenceClient(
80
  "mistralai/Mistral-7B-Instruct-v0.1"
81
  )
82
 
83
- ###### COQUI TTS FUNCTIONS ######
84
- def get_latents(speaker_wav):
85
- # create as function as we can populate here with voice cleanup/filtering
86
- gpt_cond_latent, diffusion_conditioning, speaker_embedding = model.get_conditioning_latents(audio_path=speaker_wav)
87
- return gpt_cond_latent, diffusion_conditioning, speaker_embedding
88
-
89
-
90
  def format_prompt(message, history):
91
  prompt = "<s>"
92
  for user_prompt, bot_response in history:
@@ -185,6 +178,8 @@ def bot(history, system_prompt=""):
185
  yield history
186
 
187
 
 
 
188
  def get_latents(speaker_wav):
189
  # Generate speaker embedding and latents for TTS
190
  gpt_cond_latent, diffusion_conditioning, speaker_embedding = model.get_conditioning_latents(audio_path=speaker_wav)
@@ -257,6 +252,7 @@ def generate_speech(history):
257
  else:
258
  print("RuntimeError: non device-side assert error:", str(e))
259
  raise e
 
260
  #Spoken on autoplay everysencen now produce a concataned one at the one
261
  #requires pip install ffmpeg-python
262
  files_to_concat= [ffmpeg.input(w) for w in wav_list]
 
80
  "mistralai/Mistral-7B-Instruct-v0.1"
81
  )
82
 
 
 
 
 
 
 
 
83
  def format_prompt(message, history):
84
  prompt = "<s>"
85
  for user_prompt, bot_response in history:
 
178
  yield history
179
 
180
 
181
+
182
+ ########### COQUI TTS FUNCTIONS #############
183
  def get_latents(speaker_wav):
184
  # Generate speaker embedding and latents for TTS
185
  gpt_cond_latent, diffusion_conditioning, speaker_embedding = model.get_conditioning_latents(audio_path=speaker_wav)
 
252
  else:
253
  print("RuntimeError: non device-side assert error:", str(e))
254
  raise e
255
+
256
  #Spoken on autoplay everysencen now produce a concataned one at the one
257
  #requires pip install ffmpeg-python
258
  files_to_concat= [ffmpeg.input(w) for w in wav_list]