Spaces:
Running on Zero
Running on Zero
new code
Browse filesFiles changed (2)
3 unmodified lines45678910113 unmodified linesdemo, chat_history, show_img, txt, submit_button, uploaded_pdf, slider1 = create_demo()pdf_chatbot = PDFChatBot()pdf_chatbot.create_organic_pipeline()with demo:uploaded_pdf.upload(pdf_chatbot.render_file, inputs=[uploaded_pdf,slider1], outputs=[show_img])3 unmodified lines4567893 unmodified linesdemo, chat_history, show_img, txt, submit_button, uploaded_pdf, slider1 = create_demo()pdf_chatbot = PDFChatBot()with demo:uploaded_pdf.upload(pdf_chatbot.render_file, inputs=[uploaded_pdf,slider1], outputs=[show_img])
2 unmodified lines345678910111213141516172 unmodified lines# Gradio application setupdef create_demo():# JavaScript to disable the slider after the upload button is pressedjavascript = """document.querySelector('input[type=file]').addEventListener('change', function() {if (this.files.length > 0) {document.getElementById('slider1').setAttribute('disabled', true);}});"""with gr.Blocks(title="RAG Chatbot Q&A", theme="Soft", js=javascript) as demo:with gr.Column():with gr.Row():chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=680)2 unmodified lines3456789102 unmodified lines# Gradio application setupdef create_demo():# JavaScript to disable the slider after the upload button is pressedwith gr.Blocks(title="RAG Chatbot Q&A", theme="Soft") as demo:with gr.Column():with gr.Row():chat_history = gr.Chatbot(value=[], elem_id='chatbot', height=680)
src/app.py-2
src/interface.py+1-8