new code
Browse files- src/app.py +0 -2
- src/interface.py +1 -8
src/app.py
CHANGED
|
@@ -4,8 +4,6 @@ from pdfchatbot import PDFChatBot
|
|
| 4 |
demo, chat_history, show_img, txt, submit_button, uploaded_pdf, slider1 = create_demo()
|
| 5 |
|
| 6 |
pdf_chatbot = PDFChatBot()
|
| 7 |
-
pdf_chatbot.create_organic_pipeline()
|
| 8 |
-
|
| 9 |
with demo:
|
| 10 |
uploaded_pdf.upload(pdf_chatbot.render_file, inputs=[uploaded_pdf,slider1], outputs=[show_img])
|
| 11 |
|
|
|
|
| 4 |
demo, chat_history, show_img, txt, submit_button, uploaded_pdf, slider1 = create_demo()
|
| 5 |
|
| 6 |
pdf_chatbot = PDFChatBot()
|
|
|
|
|
|
|
| 7 |
with demo:
|
| 8 |
uploaded_pdf.upload(pdf_chatbot.render_file, inputs=[uploaded_pdf,slider1], outputs=[show_img])
|
| 9 |
|
src/interface.py
CHANGED
|
@@ -3,15 +3,8 @@ import gradio as gr
|
|
| 3 |
# Gradio application setup
|
| 4 |
def create_demo():
|
| 5 |
# JavaScript to disable the slider after the upload button is pressed
|
| 6 |
-
javascript = """
|
| 7 |
-
document.querySelector('input[type=file]').addEventListener('change', function() {
|
| 8 |
-
if (this.files.length > 0) {
|
| 9 |
-
document.getElementById('slider1').setAttribute('disabled', true);
|
| 10 |
-
}
|
| 11 |
-
});
|
| 12 |
-
"""
|
| 13 |
|
| 14 |
-
with gr.Blocks(title="RAG Chatbot Q&A", theme="Soft"
|
| 15 |
with gr.Column():
|
| 16 |
with gr.Row():
|
| 17 |
chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=680)
|
|
|
|
| 3 |
# Gradio application setup
|
| 4 |
def create_demo():
|
| 5 |
# JavaScript to disable the slider after the upload button is pressed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
with gr.Blocks(title="RAG Chatbot Q&A", theme="Soft") as demo:
|
| 8 |
with gr.Column():
|
| 9 |
with gr.Row():
|
| 10 |
chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=680)
|