Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -165,18 +165,18 @@ with gr.Blocks(title="Granite PDF QA") as demo:
|
|
| 165 |
|
| 166 |
state = gr.State({"chunks": None, "index": None})
|
| 167 |
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
pdf_input.upload(load_pdf, inputs=[pdf_input, state], outputs=[pdf_status, state])
|
| 179 |
-
ask_button.click(answer_question, inputs=[question, state], outputs=answer)
|
| 180 |
|
| 181 |
if __name__ == "__main__":
|
| 182 |
demo.launch()
|
|
|
|
| 165 |
|
| 166 |
state = gr.State({"chunks": None, "index": None})
|
| 167 |
|
| 168 |
+
with gr.Row():
|
| 169 |
+
with gr.Column(scale=1):
|
| 170 |
+
pdf_input = gr.File(label="Upload PDF", file_types=[".pdf"])
|
| 171 |
+
pdf_status = gr.Textbox(label="Status", interactive=False)
|
| 172 |
+
|
| 173 |
+
with gr.Column(scale=2):
|
| 174 |
+
question = gr.Textbox(label="Your question", lines=2)
|
| 175 |
+
answer = gr.Textbox(label="Answer", lines=8)
|
| 176 |
+
ask_button = gr.Button("Ask")
|
| 177 |
+
|
| 178 |
+
pdf_input.upload(load_pdf, inputs=[pdf_input, state], outputs=[pdf_status, state])
|
| 179 |
+
ask_button.click(answer_question, inputs=[question, state], outputs=answer)
|
| 180 |
|
| 181 |
if __name__ == "__main__":
|
| 182 |
demo.launch()
|