Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ with gr.Blocks(css=css) as demo:
|
|
81 |
gr.HTML(title)
|
82 |
|
83 |
with gr.Column():
|
84 |
-
openai_key = gr.Textbox(label="
|
85 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
86 |
with gr.Row():
|
87 |
langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
@@ -90,7 +90,7 @@ with gr.Blocks(css=css) as demo:
|
|
90 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
91 |
question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
|
92 |
submit_btn = gr.Button("Send Message")
|
93 |
-
load_pdf.click(
|
94 |
load_pdf.click(pdf_changes, inputs=[pdf_doc, openai_key], outputs=[langchain_status], queue=False)
|
95 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|
96 |
bot, chatbot, chatbot
|
|
|
81 |
gr.HTML(title)
|
82 |
|
83 |
with gr.Column():
|
84 |
+
openai_key = gr.Textbox(label="Your OpenAI API key", type="password")
|
85 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
86 |
with gr.Row():
|
87 |
langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
|
|
90 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
91 |
question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
|
92 |
submit_btn = gr.Button("Send Message")
|
93 |
+
load_pdf.click(loading_pdf, None, langchain_status, queue=False)
|
94 |
load_pdf.click(pdf_changes, inputs=[pdf_doc, openai_key], outputs=[langchain_status], queue=False)
|
95 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|
96 |
bot, chatbot, chatbot
|