Spaces:
Paused
Paused
To main, first functional
Browse files
app.py
CHANGED
@@ -91,9 +91,9 @@ def get_answer_page(response):
|
|
91 |
# Implement logic to retrieve the page number or an image of the page with the answer.
|
92 |
# best image
|
93 |
best_match = response.source_nodes[0].metadata["file_path"]
|
94 |
-
answer_page =
|
95 |
image = Image.open(best_match.replace("txt", "png"))
|
96 |
-
return image, answer_page
|
97 |
|
98 |
|
99 |
# Create the gr.Interface function
|
|
|
91 |
# Implement logic to retrieve the page number or an image of the page with the answer.
|
92 |
# best image
|
93 |
best_match = response.source_nodes[0].metadata["file_path"]
|
94 |
+
answer_page = int(best_match[-8:-4])
|
95 |
image = Image.open(best_match.replace("txt", "png"))
|
96 |
+
return image, f"Navigate to page {answer_page}"
|
97 |
|
98 |
|
99 |
# Create the gr.Interface function
|