Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -47,10 +47,6 @@ model.eval()
|
|
47 |
TTS_VOICES = [
|
48 |
"en-US-JennyNeural", # @tts1
|
49 |
"en-US-GuyNeural", # @tts2
|
50 |
-
"en-US-AriaNeural", # @tts3
|
51 |
-
"en-US-DavisNeural", # @tts4
|
52 |
-
"en-US-JaneNeural", # @tts5
|
53 |
-
"en-US-JasonNeural", # @tts6
|
54 |
]
|
55 |
|
56 |
# Load multimodal (OCR) model and processor
|
@@ -105,8 +101,8 @@ def generate(
|
|
105 |
images = []
|
106 |
|
107 |
tts_prefix = "@tts"
|
108 |
-
is_tts = any(text.strip().lower().startswith(f"{tts_prefix}{i}") for i in range(1,
|
109 |
-
voice_index = next((i for i in range(1,
|
110 |
|
111 |
if is_tts and voice_index:
|
112 |
voice = TTS_VOICES[voice_index - 1]
|
|
|
47 |
TTS_VOICES = [
|
48 |
"en-US-JennyNeural", # @tts1
|
49 |
"en-US-GuyNeural", # @tts2
|
|
|
|
|
|
|
|
|
50 |
]
|
51 |
|
52 |
# Load multimodal (OCR) model and processor
|
|
|
101 |
images = []
|
102 |
|
103 |
tts_prefix = "@tts"
|
104 |
+
is_tts = any(text.strip().lower().startswith(f"{tts_prefix}{i}") for i in range(1, 3))
|
105 |
+
voice_index = next((i for i in range(1, 3) if text.strip().lower().startswith(f"{tts_prefix}{i}")), None)
|
106 |
|
107 |
if is_tts and voice_index:
|
108 |
voice = TTS_VOICES[voice_index - 1]
|