Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
2ae1039
1
Parent(s):
5c33ee3
Prints out the version info
Browse files
my_gui.py
CHANGED
|
@@ -52,7 +52,9 @@ with gr.Blocks(css=custom_css) as my_gui:
|
|
| 52 |
|
| 53 |
gr.HTML(custom_html)
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
|
| 57 |
with gr.Column(scale=1):
|
| 58 |
|
|
@@ -112,7 +114,8 @@ with gr.Blocks(css=custom_css) as my_gui:
|
|
| 112 |
inputs=[page_range_slider],
|
| 113 |
outputs=[
|
| 114 |
md_result,
|
| 115 |
-
raw_text_result
|
|
|
|
| 116 |
],
|
| 117 |
queue=False,
|
| 118 |
).success(
|
|
|
|
| 52 |
|
| 53 |
gr.HTML(custom_html)
|
| 54 |
|
| 55 |
+
version_info = gr.Text(value="Welcome to the PyMuPDF Extraction Demo", interactive=False, show_label=False)
|
| 56 |
+
|
| 57 |
+
with gr.Row():
|
| 58 |
|
| 59 |
with gr.Column(scale=1):
|
| 60 |
|
|
|
|
| 114 |
inputs=[page_range_slider],
|
| 115 |
outputs=[
|
| 116 |
md_result,
|
| 117 |
+
raw_text_result,
|
| 118 |
+
version_info
|
| 119 |
],
|
| 120 |
queue=False,
|
| 121 |
).success(
|
my_io.py
CHANGED
|
@@ -27,6 +27,7 @@ def ready(file, page_num:int):
|
|
| 27 |
|
| 28 |
def convertToMD(page_num:int, checkboxes:str = None, radios:str = None):
|
| 29 |
|
|
|
|
| 30 |
choice_table_strategy = radios
|
| 31 |
choice_page_separators = False
|
| 32 |
choice_embed_images = False
|
|
@@ -48,7 +49,7 @@ def convertToMD(page_num:int, checkboxes:str = None, radios:str = None):
|
|
| 48 |
page_range = range(0, page_num)
|
| 49 |
md = pymupdf4llm.to_markdown(doc,
|
| 50 |
pages = page_range)
|
| 51 |
-
return md, md
|
| 52 |
|
| 53 |
def convertComplete():
|
| 54 |
print("conversion complete")
|
|
|
|
| 27 |
|
| 28 |
def convertToMD(page_num:int, checkboxes:str = None, radios:str = None):
|
| 29 |
|
| 30 |
+
version = f"Processed using: {pymupdf.version=}, {pymupdf4llm.version=}"
|
| 31 |
choice_table_strategy = radios
|
| 32 |
choice_page_separators = False
|
| 33 |
choice_embed_images = False
|
|
|
|
| 49 |
page_range = range(0, page_num)
|
| 50 |
md = pymupdf4llm.to_markdown(doc,
|
| 51 |
pages = page_range)
|
| 52 |
+
return md, md, version
|
| 53 |
|
| 54 |
def convertComplete():
|
| 55 |
print("conversion complete")
|