jsbeaudry commited on
Commit
0e263e1
·
verified ·
1 Parent(s): efe3a7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- ai_conversation = AsyncAIConversation()
367
-
368
- # Initialize all models
369
- await ai_conversation.initialize_models()
 
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: