bcci commited on
Commit
8fb9964
·
verified ·
1 Parent(s): d352468

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -208,7 +208,8 @@ def tts_streaming(text: str, voice: str = "af_heart", speed: float = 1.0, format
208
  final_token = [[0, *chunk_tokens, 0]]
209
 
210
  # Use the number of tokens to select the appropriate style vector.
211
- style_index = len(tokens_to_send)
 
212
  if style_index >= len(voices):
213
  style_index = len(voices) - 1 # Fallback if index is out-of-bounds.
214
  ref_s = voices[style_index]
 
208
  final_token = [[0, *chunk_tokens, 0]]
209
 
210
  # Use the number of tokens to select the appropriate style vector.
211
+ style_index = len(final_token)
212
+ print(len(voices))
213
  if style_index >= len(voices):
214
  style_index = len(voices) - 1 # Fallback if index is out-of-bounds.
215
  ref_s = voices[style_index]