small edit when failing
Browse files
app.py
CHANGED
@@ -154,8 +154,6 @@ def add_pagenumbers(im_list, height_scale=40):
|
|
154 |
|
155 |
|
156 |
def pdf_to_grid(pdf_path):
|
157 |
-
|
158 |
-
|
159 |
reader = PyPDF2.PdfReader(pdf_path)
|
160 |
reached_page_limit = False
|
161 |
images = []
|
@@ -193,10 +191,10 @@ def main(complexity, evidence, form, operation, type):
|
|
193 |
)
|
194 |
results = DIAGNOSTIC_TEST.query(query)
|
195 |
if len(results) == 0:
|
196 |
-
return f"No results found for query {query}", "", "", ""
|
197 |
|
198 |
for i, sample in results.sample(frac=1).iterrows():
|
199 |
-
print("Sampled: ", sample[
|
200 |
|
201 |
# first get PDF file
|
202 |
PDF, grid = None, None
|
@@ -218,7 +216,7 @@ def main(complexity, evidence, form, operation, type):
|
|
218 |
|
219 |
|
220 |
# test
|
221 |
-
#q, a, d, im, f = main(*slider_defaults)
|
222 |
|
223 |
outputs = [
|
224 |
gr.Textbox(label="question"),
|
@@ -229,4 +227,4 @@ outputs = [
|
|
229 |
]
|
230 |
|
231 |
iface = gr.Interface(fn=main, inputs=sliders, outputs=outputs, description="Visualize diagnostic samples from DUDE")
|
232 |
-
iface.launch(share=True)
|
|
|
154 |
|
155 |
|
156 |
def pdf_to_grid(pdf_path):
|
|
|
|
|
157 |
reader = PyPDF2.PdfReader(pdf_path)
|
158 |
reached_page_limit = False
|
159 |
images = []
|
|
|
191 |
)
|
192 |
results = DIAGNOSTIC_TEST.query(query)
|
193 |
if len(results) == 0:
|
194 |
+
return f"No results found for query {query}", "", "", "", ""
|
195 |
|
196 |
for i, sample in results.sample(frac=1).iterrows():
|
197 |
+
print("Sampled: ", sample["nhash"])
|
198 |
|
199 |
# first get PDF file
|
200 |
PDF, grid = None, None
|
|
|
216 |
|
217 |
|
218 |
# test
|
219 |
+
# q, a, d, im, f = main(*slider_defaults)
|
220 |
|
221 |
outputs = [
|
222 |
gr.Textbox(label="question"),
|
|
|
227 |
]
|
228 |
|
229 |
iface = gr.Interface(fn=main, inputs=sliders, outputs=outputs, description="Visualize diagnostic samples from DUDE")
|
230 |
+
iface.launch(share=True)
|