Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ css="""
|
|
| 46 |
"""
|
| 47 |
|
| 48 |
title = """
|
| 49 |
-
<div style="text-align: center;max-width: 700px
|
| 50 |
<h1>Chat with PDF</h1>
|
| 51 |
<p style="text-align: center;">Upload a .PDF from your computer, click the "Load PDF to LangChain" button, <br />
|
| 52 |
when everything is ready, you can start asking questions about the pdf ;)</p>
|
|
@@ -57,16 +57,16 @@ title = """
|
|
| 57 |
with gr.Blocks() as demo:
|
| 58 |
with gr.Column(elem_id="col-container"):
|
| 59 |
gr.HTML(title)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
with gr.Row():
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
langchain_status = gr.Textbox()
|
| 64 |
-
load_pdf = gr.Button("Load pdf to langchain")
|
| 65 |
-
with gr.Column():
|
| 66 |
-
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
| 67 |
-
with gr.Row():
|
| 68 |
-
question = gr.Textbox(label="Question")
|
| 69 |
-
clear = gr.Button("Clear")
|
| 70 |
|
| 71 |
load_pdf.click(pdf_changes, pdf_doc, langchain_status, queue=False)
|
| 72 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|
|
|
|
| 46 |
"""
|
| 47 |
|
| 48 |
title = """
|
| 49 |
+
<div style="text-align: center;max-width: 700px;">
|
| 50 |
<h1>Chat with PDF</h1>
|
| 51 |
<p style="text-align: center;">Upload a .PDF from your computer, click the "Load PDF to LangChain" button, <br />
|
| 52 |
when everything is ready, you can start asking questions about the pdf ;)</p>
|
|
|
|
| 57 |
with gr.Blocks() as demo:
|
| 58 |
with gr.Column(elem_id="col-container"):
|
| 59 |
gr.HTML(title)
|
| 60 |
+
|
| 61 |
+
with gr.Row():
|
| 62 |
+
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
| 63 |
+
langchain_status = gr.Textbox(label="Status")
|
| 64 |
+
load_pdf = gr.Button("Load pdf to langchain")
|
| 65 |
+
|
| 66 |
+
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
| 67 |
with gr.Row():
|
| 68 |
+
question = gr.Textbox(label="Question")
|
| 69 |
+
clear = gr.Button("Clear")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
load_pdf.click(pdf_changes, pdf_doc, langchain_status, queue=False)
|
| 72 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|