prithivMLmods commited on
Commit
37efd95
·
verified ·
1 Parent(s): c1f7ac1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -78,9 +78,9 @@ def generate(
78
  if is_tts:
79
  # Extract the number after @tts
80
  tts_part = message.strip().lower().split()[0] # Get the @ttsX part
81
- if len(tts_part) > 4: # Check if it's @ttsX (e.g., @tts1, @tts2, etc.)
82
  try:
83
- tts_index = int(tts_part[4:]) - 1 # Convert to 0-based index
84
  if tts_index < 0 or tts_index >= len(voices):
85
  gr.Warning(f"Invalid TTS voice index. Using default voice.")
86
  tts_index = 0
 
78
  if is_tts:
79
  # Extract the number after @tts
80
  tts_part = message.strip().lower().split()[0] # Get the @ttsX part
81
+ if len(tts_part) > 8: # Check if it's @ttsX (e.g., @tts1, @tts2, etc.)
82
  try:
83
+ tts_index = int(tts_part[8:]) - 1 # Convert to 0-based index
84
  if tts_index < 0 or tts_index >= len(voices):
85
  gr.Warning(f"Invalid TTS voice index. Using default voice.")
86
  tts_index = 0