Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 84 |
-
with gr.Blocks(
|
| 85 |
gr.Markdown(
|
| 86 |
"""
|
| 87 |
-
# π
|
| 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"],
|
| 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 |
-
|
|
|
|
|
|
| 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"))
|