bcci commited on
Commit
32e83f8
·
verified ·
1 Parent(s): 3e265d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -198,7 +198,7 @@ def tts_streaming(text: str, voice: str = "af_heart", speed: float = 1.0, format
198
  if i == 0:
199
  tokens_to_send = [0] + chunk_tokens + [0]
200
  else:
201
- tokens_to_send = [prev_last_token] + chunk_tokens + [0]
202
  # token_to_send = [0] + chunk_tokens + [0]
203
 
204
  # Save the last token of this chunk for the next iteration.
@@ -206,9 +206,10 @@ def tts_streaming(text: str, voice: str = "af_heart", speed: float = 1.0, format
206
 
207
  # Prepare the model input (a batch of one sequence).
208
  final_token = [tokens_to_send]
 
209
 
210
  # Use the number of tokens to select the appropriate style vector.
211
- style_index = len(chunk_tokens) + 2
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]
 
198
  if i == 0:
199
  tokens_to_send = [0] + chunk_tokens + [0]
200
  else:
201
+ tokens_to_send = [0] + [prev_last_token] + chunk_tokens + [0]
202
  # token_to_send = [0] + chunk_tokens + [0]
203
 
204
  # Save the last token of this chunk for the next iteration.
 
206
 
207
  # Prepare the model input (a batch of one sequence).
208
  final_token = [tokens_to_send]
209
+ print(final_token)
210
 
211
  # Use the number of tokens to select the appropriate style vector.
212
+ style_index = len(chunk_tokens) + 1
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]