Update app.py
Browse files
app.py
CHANGED
@@ -170,15 +170,23 @@ with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
|
|
170 |
outputs=greeting_output
|
171 |
)
|
172 |
|
173 |
-
with gr.Tab("Indexing"):
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
# Launch the Gradio app.
|
184 |
# The `share=True` argument creates a public, shareable link (useful for demos).
|
|
|
170 |
outputs=greeting_output
|
171 |
)
|
172 |
|
173 |
+
# with gr.Tab("Indexing"):
|
174 |
+
# pdf_input = gr.File(label="Upload PDF", file_types=[".pdf"])
|
175 |
+
# index_button = gr.Button("Index PDF")
|
176 |
+
# load_sample = gr.Button("Alternatively, Load and Index [Attention Is All You Need.pdf] as a Sample")
|
177 |
+
# sample_description = gr.Markdown("This sample PDF is a seminal paper in the field of machine learning, titled 'Attention Is All You Need' at https://arxiv.org/abs/1706.03762. It introduces the Transformer model, which has become foundational in natural language processing.")
|
178 |
+
# index_output = gr.Textbox(label="Indexing Status")
|
179 |
+
# index_button.click(index_pdf, inputs=pdf_input, outputs=index_output)
|
180 |
+
# load_sample.click(load_sample_pdf, inputs=None, outputs=index_output)
|
181 |
+
|
182 |
+
with gr.Tab("Chatbot"):
|
183 |
+
gr.ChatInterface(
|
184 |
+
fn=generate_response,
|
185 |
+
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
186 |
+
examples=examples_questions,
|
187 |
+
additional_inputs=additional_inputs,
|
188 |
+
cache_examples=False,
|
189 |
+
)
|
190 |
|
191 |
# Launch the Gradio app.
|
192 |
# The `share=True` argument creates a public, shareable link (useful for demos).
|