Commit
•
9ca9bbb
1
Parent(s):
252280a
Update app.py
Browse files
app.py
CHANGED
@@ -114,6 +114,7 @@ def app_outputs_by_model(uploaded_pdf, model_id, model, tokenizer, max_length, i
|
|
114 |
for i in range(num_images):
|
115 |
if filename != "files/blank.png": img_file = f"img_{i}_" + filename.replace(".pdf", ".png")
|
116 |
else: img_file = filename.replace(".pdf", ".png")
|
|
|
117 |
images[i].save(img_file)
|
118 |
img_files.append(img_file)
|
119 |
|
@@ -131,6 +132,7 @@ def app_outputs_by_model(uploaded_pdf, model_id, model, tokenizer, max_length, i
|
|
131 |
csv_files = list()
|
132 |
for i in range(max_imgboxes):
|
133 |
csv_file = f"csv_{i}_" + filename.replace(".pdf", ".csv")
|
|
|
134 |
csv_files.append(gr.File.update(value=csv_file, visible=True))
|
135 |
df[i].to_csv(csv_file, encoding="utf-8", index=False)
|
136 |
|
|
|
114 |
for i in range(num_images):
|
115 |
if filename != "files/blank.png": img_file = f"img_{i}_" + filename.replace(".pdf", ".png")
|
116 |
else: img_file = filename.replace(".pdf", ".png")
|
117 |
+
img_file = img_file.replace("/", "_")
|
118 |
images[i].save(img_file)
|
119 |
img_files.append(img_file)
|
120 |
|
|
|
132 |
csv_files = list()
|
133 |
for i in range(max_imgboxes):
|
134 |
csv_file = f"csv_{i}_" + filename.replace(".pdf", ".csv")
|
135 |
+
csv_file = csv_file.replace("/", "_")
|
136 |
csv_files.append(gr.File.update(value=csv_file, visible=True))
|
137 |
df[i].to_csv(csv_file, encoding="utf-8", index=False)
|
138 |
|