prithivMLmods commited on
Commit
49d0c17
·
verified ·
1 Parent(s): 4b064b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -12
app.py CHANGED
@@ -231,7 +231,8 @@ def ragent_reasoning(prompt: str, history: list[dict], max_tokens: int = 1024, t
231
  # Gradio UI configuration
232
 
233
  DESCRIPTION = """
234
- # Agent Dino 🌠 """
 
235
 
236
  css = '''
237
  h1 {
@@ -568,20 +569,22 @@ def generate(
568
  output_file = asyncio.run(text_to_speech(final_response, voice))
569
  yield gr.Audio(output_file, autoplay=True)
570
 
571
- # Gradio Chat Interface Setup and Launch using Blocks with Sidebar
572
 
573
  with gr.Blocks(css=css) as demo:
574
  with gr.Sidebar(label="Usage", open=True):
575
  gr.Markdown(
576
- "### About Space\n\n"
577
- "This chat interface supports multiple commands:\n"
578
- "- `@tts1` or `@tts2`: Triggers text-to-speech.\n"
579
- "- `@image`: Generates an image using Stable Diffusion XL.\n"
580
- "- `@3d`: Generates a 3D model using the ShapE pipeline.\n"
581
- "- `@web`: Performs a web search or visits a webpage.\n"
582
- "- `@rAgent`: Initiates a reasoning chain using Llama mode OpenAI."
 
 
 
583
  )
584
-
585
  chat_interface = gr.ChatInterface(
586
  fn=generate,
587
  additional_inputs=[
@@ -602,14 +605,16 @@ with gr.Blocks(css=css) as demo:
602
  cache_examples=False,
603
  type="messages",
604
  description=DESCRIPTION,
605
- css=css,
606
  fill_height=True,
607
  textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple"),
608
  stop_btn="Stop Generation",
609
  multimodal=True,
610
  )
611
 
612
- # Ensure the static folder is mounted for serving generated files.
 
 
 
613
  from fastapi.staticfiles import StaticFiles
614
  demo.app.mount("/static", StaticFiles(directory="static"), name="static")
615
 
 
231
  # Gradio UI configuration
232
 
233
  DESCRIPTION = """
234
+ # Agent Dino 🌠
235
+ """
236
 
237
  css = '''
238
  h1 {
 
569
  output_file = asyncio.run(text_to_speech(final_response, voice))
570
  yield gr.Audio(output_file, autoplay=True)
571
 
572
+ # Gradio Chat Interface Setup and Launch with Sidebar
573
 
574
  with gr.Blocks(css=css) as demo:
575
  with gr.Sidebar(label="Usage", open=True):
576
  gr.Markdown(
577
+ """
578
+ ### About Space
579
+
580
+ This chat interface supports multiple commands:
581
+ - `@tts1` or `@tts2`: Triggers text-to-speech.
582
+ - `@image`: Generates an image using Stable Diffusion XL.
583
+ - `@3d`: Generates a 3D model using the ShapE pipeline.
584
+ - `@web`: Performs a web search or visits a webpage.
585
+ - `@rAgent`: Initiates a reasoning chain using Llama mode OpenAI.
586
+ """
587
  )
 
588
  chat_interface = gr.ChatInterface(
589
  fn=generate,
590
  additional_inputs=[
 
605
  cache_examples=False,
606
  type="messages",
607
  description=DESCRIPTION,
 
608
  fill_height=True,
609
  textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple"),
610
  stop_btn="Stop Generation",
611
  multimodal=True,
612
  )
613
 
614
+ # Ensure the static folder exists
615
+ if not os.path.exists("static"):
616
+ os.makedirs("static")
617
+
618
  from fastapi.staticfiles import StaticFiles
619
  demo.app.mount("/static", StaticFiles(directory="static"), name="static")
620