Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
from pathlib import Path
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
def upload_file(filepath):
|
| 5 |
name = Path(filepath).name
|
|
|
|
|
|
|
|
|
|
| 6 |
return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {name}", value=filepath, visible=True)]
|
| 7 |
|
| 8 |
def download_file():
|
|
|
|
| 1 |
from pathlib import Path
|
| 2 |
import gradio as gr
|
| 3 |
+
import fitz
|
| 4 |
|
| 5 |
def upload_file(filepath):
|
| 6 |
name = Path(filepath).name
|
| 7 |
+
# load pdf
|
| 8 |
+
doc = fitz.open(filepath)
|
| 9 |
+
# now create the excel file
|
| 10 |
return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {name}", value=filepath, visible=True)]
|
| 11 |
|
| 12 |
def download_file():
|