Update app.py
Browse files
app.py
CHANGED
@@ -30,11 +30,13 @@ desc = """
|
|
30 |
It works by first retrieving relevant documents from an external knowledge source (like PDF files) and then using a LLM model to produce responses based on both the input query and the retrieved content.
|
31 |
This method enhances factual correctness and allows the model to access up-to-date or domain-specific information without retraining.
|
32 |
|
33 |
-
Click the button below to load a **User Guide** and an **Installation Guide** for
|
34 |
Once you see the message *"PDF indexed successfully!"*, go to the **Chatbot** tab to ask any relevant questions about the device.
|
35 |
|
36 |
"""
|
37 |
|
|
|
|
|
38 |
|
39 |
examples_questions = [["How long is the lifespan of this smoke alarm?"],
|
40 |
["How often should I change the battery?"],
|
@@ -148,7 +150,7 @@ with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
|
|
148 |
# pdf_input = gr.Textbox(label="PDF File")
|
149 |
# index_button = gr.Button("Index PDF")
|
150 |
# load_sample = gr.Button("Alternatively, Load and Index [Attention Is All You Need.pdf] as a Sample")
|
151 |
-
load_sample = gr.Button(
|
152 |
index_output = gr.Textbox(label="Indexing Status")
|
153 |
# index_button.click(index_pdf, inputs=pdf_input, outputs=index_output)
|
154 |
load_sample.click(load_sample_pdf, inputs=None, outputs=index_output)
|
|
|
30 |
It works by first retrieving relevant documents from an external knowledge source (like PDF files) and then using a LLM model to produce responses based on both the input query and the retrieved content.
|
31 |
This method enhances factual correctness and allows the model to access up-to-date or domain-specific information without retraining.
|
32 |
|
33 |
+
Click the button below to load a **User Guide** and an **Installation Guide** for a smoke alarm device into the vector database.
|
34 |
Once you see the message *"PDF indexed successfully!"*, go to the **Chatbot** tab to ask any relevant questions about the device.
|
35 |
|
36 |
"""
|
37 |
|
38 |
+
sample_button = "Load User Guide and Installation Guide documents"
|
39 |
+
|
40 |
|
41 |
examples_questions = [["How long is the lifespan of this smoke alarm?"],
|
42 |
["How often should I change the battery?"],
|
|
|
150 |
# pdf_input = gr.Textbox(label="PDF File")
|
151 |
# index_button = gr.Button("Index PDF")
|
152 |
# load_sample = gr.Button("Alternatively, Load and Index [Attention Is All You Need.pdf] as a Sample")
|
153 |
+
load_sample = gr.Button(sample_button)
|
154 |
index_output = gr.Textbox(label="Indexing Status")
|
155 |
# index_button.click(index_pdf, inputs=pdf_input, outputs=index_output)
|
156 |
load_sample.click(load_sample_pdf, inputs=None, outputs=index_output)
|