Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -357,16 +357,17 @@ async def demo_conversation():
|
|
| 357 |
# print(f"Error testing Kokoro TTS: {e}")
|
| 358 |
|
| 359 |
|
| 360 |
-
|
| 361 |
|
| 362 |
# Create the async function wrapper for Gradio
|
| 363 |
async def process_audio_gradio(audio_file, system_prompt_input):
|
| 364 |
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
|
|
|
| 370 |
|
| 371 |
"""Processes audio file and system prompt for Gradio interface."""
|
| 372 |
if audio_file is None:
|
|
|
|
| 357 |
# print(f"Error testing Kokoro TTS: {e}")
|
| 358 |
|
| 359 |
|
| 360 |
+
isLoaded = False
|
| 361 |
|
| 362 |
# Create the async function wrapper for Gradio
|
| 363 |
async def process_audio_gradio(audio_file, system_prompt_input):
|
| 364 |
|
| 365 |
+
if(isLoaded==false):
|
| 366 |
+
ai_conversation = AsyncAIConversation()
|
| 367 |
+
# Initialize all models
|
| 368 |
+
await ai_conversation.initialize_models()
|
| 369 |
+
isLoaded = True
|
| 370 |
+
|
| 371 |
|
| 372 |
"""Processes audio file and system prompt for Gradio interface."""
|
| 373 |
if audio_file is None:
|