Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -358,17 +358,9 @@ async def demo_conversation():
|
|
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:
|
374 |
return "Please upload an audio file.", "", "", None
|
@@ -399,6 +391,12 @@ async def process_audio_gradio(audio_file, system_prompt_input):
|
|
399 |
with gr.Blocks() as demo:
|
400 |
gr.Markdown("# Asynchronous AI Conversation System")
|
401 |
gr.Markdown("Upload an audio file and provide a system prompt to get a response.")
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
403 |
with gr.Row():
|
404 |
audio_input = gr.Audio(label="Upload Audio File", type="filepath")
|
|
|
358 |
|
359 |
|
360 |
isLoaded = False
|
|
|
361 |
# Create the async function wrapper for Gradio
|
362 |
async def process_audio_gradio(audio_file, system_prompt_input):
|
363 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
"""Processes audio file and system prompt for Gradio interface."""
|
365 |
if audio_file is None:
|
366 |
return "Please upload an audio file.", "", "", None
|
|
|
391 |
with gr.Blocks() as demo:
|
392 |
gr.Markdown("# Asynchronous AI Conversation System")
|
393 |
gr.Markdown("Upload an audio file and provide a system prompt to get a response.")
|
394 |
+
|
395 |
+
if(isLoaded==false):
|
396 |
+
ai_conversation = AsyncAIConversation()
|
397 |
+
# Initialize all models
|
398 |
+
await ai_conversation.initialize_models()
|
399 |
+
isLoaded = True
|
400 |
|
401 |
with gr.Row():
|
402 |
audio_input = gr.Audio(label="Upload Audio File", type="filepath")
|