Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,21 +48,20 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
|
|
48 |
with gr.Column():
|
49 |
openai_key = gr.Textbox(label="Your GPT-4 OpenAI API key", type="password")
|
50 |
pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
|
|
|
|
|
|
|
|
|
51 |
with gr.Row():
|
52 |
-
|
53 |
-
|
|
|
54 |
|
55 |
-
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
56 |
-
question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
|
57 |
-
submit_btn = gr.Button("Send Message")
|
58 |
|
59 |
-
load_pdf.click(load_pdf, inputs=[pdf_doc, openai_key], outputs=
|
60 |
|
61 |
-
submit_btn.click(answer_query,
|
62 |
|
63 |
|
64 |
#forcing a save in order to re-build the container.
|
65 |
demo.launch()
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
48 |
with gr.Column():
|
49 |
openai_key = gr.Textbox(label="Your GPT-4 OpenAI API key", type="password")
|
50 |
pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
|
51 |
+
|
52 |
+
with gr.Row():
|
53 |
+
status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
54 |
+
load_pdf = gr.Button("Load PDF to LangChain")
|
55 |
with gr.Row():
|
56 |
+
input = gr.Textbox(label="Type in your question")
|
57 |
+
output = gr.Textbox(label="Answer")
|
58 |
+
submit_query = gr.Button("Submit")
|
59 |
|
|
|
|
|
|
|
60 |
|
61 |
+
load_pdf.click(load_pdf, inputs=[pdf_doc, openai_key], outputs=status)
|
62 |
|
63 |
+
submit_btn.click(answer_query,input,ouput)
|
64 |
|
65 |
|
66 |
#forcing a save in order to re-build the container.
|
67 |
demo.launch()
|
|
|
|
|
|