Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,7 @@ css = """
|
|
90 |
|
91 |
# HTML
|
92 |
title = """
|
93 |
-
<div style="text-align: center;max-width:
|
94 |
<h1>Chat with PDF</h1>
|
95 |
<p style="text-align: center;">Upload a .pdf from local machine, click the "Load PDF🚀" button, <br />
|
96 |
When ready, you are all set to start asking questions from the pdf</p>
|
@@ -100,7 +100,7 @@ with gr.Blocks(css=css) as demo:
|
|
100 |
with gr.Column(elem_id="col-container"):
|
101 |
gr.HTML(title)
|
102 |
|
103 |
-
with gr.Column():
|
104 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
105 |
repo_id = gr.Dropdown(label="LLM", choices=["google/flan-ul2", "OpenAssistant/oasst-sft-1-pythia-12b", "bigscience/bloomz", "meta-llama/Llama-2-7b-chat-hf"], value="google/flan-ul2")
|
106 |
with gr.Row():
|
@@ -108,7 +108,7 @@ with gr.Blocks(css=css) as demo:
|
|
108 |
load_pdf = gr.Button("Load pdf to langchain")
|
109 |
|
110 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
111 |
-
question = gr.Textbox(label="Question", placeholder="Type your
|
112 |
submit_btn = gr.Button("Send message")
|
113 |
#load_pdf.click(loading_pdf, None, langchain_status, queue=False)
|
114 |
repo_id.change(pdf_changes, inputs=[pdf_doc, repo_id], outputs=[langchain_status], queue=False)
|
|
|
90 |
|
91 |
# HTML
|
92 |
title = """
|
93 |
+
<div style="text-align: center;max-width: 800px;">
|
94 |
<h1>Chat with PDF</h1>
|
95 |
<p style="text-align: center;">Upload a .pdf from local machine, click the "Load PDF🚀" button, <br />
|
96 |
When ready, you are all set to start asking questions from the pdf</p>
|
|
|
100 |
with gr.Column(elem_id="col-container"):
|
101 |
gr.HTML(title)
|
102 |
|
103 |
+
with gr.Column(elem_id="col-container"):
|
104 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
105 |
repo_id = gr.Dropdown(label="LLM", choices=["google/flan-ul2", "OpenAssistant/oasst-sft-1-pythia-12b", "bigscience/bloomz", "meta-llama/Llama-2-7b-chat-hf"], value="google/flan-ul2")
|
106 |
with gr.Row():
|
|
|
108 |
load_pdf = gr.Button("Load pdf to langchain")
|
109 |
|
110 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
111 |
+
question = gr.Textbox(label="Question", placeholder="Type your Question and hit Enter ",elem_id="chatbot .user-message")
|
112 |
submit_btn = gr.Button("Send message")
|
113 |
#load_pdf.click(loading_pdf, None, langchain_status, queue=False)
|
114 |
repo_id.change(pdf_changes, inputs=[pdf_doc, repo_id], outputs=[langchain_status], queue=False)
|