Update app.py
Browse files
app.py
CHANGED
@@ -203,6 +203,7 @@ def convert_pdf_to_images(pdf_path, image_folder="pdf_images", dpi=300):
|
|
203 |
return image_paths
|
204 |
|
205 |
|
|
|
206 |
def display_pdf_images(file):
|
207 |
# 转换PDF为高清图像
|
208 |
image_paths = convert_pdf_to_images(file)
|
@@ -313,7 +314,7 @@ with gr.Blocks(title="Automated Enzyme Kinetics Extractor") as demo:
|
|
313 |
|
314 |
with gr.Row():
|
315 |
with gr.Column(scale=1):
|
316 |
-
file_out = gr.Gallery(label="PDF Viewer", columns=1, rows=1,
|
317 |
|
318 |
with gr.Column(scale=1):
|
319 |
text_output = gr.Textbox(
|
|
|
203 |
return image_paths
|
204 |
|
205 |
|
206 |
+
@functools.lru_cache(maxsize=128)
|
207 |
def display_pdf_images(file):
|
208 |
# 转换PDF为高清图像
|
209 |
image_paths = convert_pdf_to_images(file)
|
|
|
314 |
|
315 |
with gr.Row():
|
316 |
with gr.Column(scale=1):
|
317 |
+
file_out = gr.Gallery(label="PDF Viewer", columns=1, rows=1, object_fit="contain")
|
318 |
|
319 |
with gr.Column(scale=1):
|
320 |
text_output = gr.Textbox(
|