bkbilal09 commited on
Commit
67fd7e7
Β·
verified Β·
1 Parent(s): b05bc7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -80,18 +80,18 @@ def rag_pipeline(query, model_choice):
80
  except Exception as e:
81
  return f"❌ Error generating answer: {str(e)}", chat_history
82
 
83
- # Gradio UI with professional theme
84
- with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="violet")) as demo:
85
  gr.Markdown(
86
  """
87
- # 🌟 New RAG Space Bilal
88
  ### Upload multiple documents and ask optimized questions
89
  ---
90
  """
91
  )
92
 
93
  with gr.Tab("Upload Files"):
94
- file_input = gr.File(label="πŸ“‚ Upload PDF or Text Files", file_types=[".pdf", ".txt"], file_types_allow_multiple=True)
95
  process_btn = gr.Button("πŸš€ Process Files")
96
  status_output = gr.Textbox(label="Status", interactive=False)
97
  process_btn.click(process_files, inputs=file_input, outputs=status_output)
@@ -109,4 +109,5 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="violet"))
109
 
110
  ask_btn.click(rag_pipeline, inputs=[query_input, model_choice], outputs=[answer_output, history_output])
111
 
112
- demo.launch()
 
 
80
  except Exception as e:
81
  return f"❌ Error generating answer: {str(e)}", chat_history
82
 
83
+ # Gradio UI
84
+ with gr.Blocks() as demo:
85
  gr.Markdown(
86
  """
87
+ # 🌟 ContextPilot Bilal
88
  ### Upload multiple documents and ask optimized questions
89
  ---
90
  """
91
  )
92
 
93
  with gr.Tab("Upload Files"):
94
+ file_input = gr.File(label="πŸ“‚ Upload PDF or Text Files", file_types=[".pdf", ".txt"], type="file", file_types_multiple=True)
95
  process_btn = gr.Button("πŸš€ Process Files")
96
  status_output = gr.Textbox(label="Status", interactive=False)
97
  process_btn.click(process_files, inputs=file_input, outputs=status_output)
 
109
 
110
  ask_btn.click(rag_pipeline, inputs=[query_input, model_choice], outputs=[answer_output, history_output])
111
 
112
+ # βœ… Pass theme in launch (Gradio 6.0 change)
113
+ demo.launch(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="violet"))