Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import json
|
|
| 6 |
import re
|
| 7 |
import time
|
| 8 |
import zipfile
|
|
|
|
| 9 |
from pathlib import Path
|
| 10 |
|
| 11 |
os.system('pip uninstall -y mineru')
|
|
@@ -32,10 +33,11 @@ try:
|
|
| 32 |
file.seek(0) # 将文件指针移回文件开始位置
|
| 33 |
file.truncate() # 截断文件,清除原有内容
|
| 34 |
json.dump(config, file, indent=4) # 写入新内容
|
|
|
|
|
|
|
| 35 |
|
| 36 |
from gradio_pdf import PDF
|
| 37 |
import gradio as gr
|
| 38 |
-
from loguru import logger
|
| 39 |
|
| 40 |
from mineru.cli.common import prepare_env, read_fn, aio_do_parse
|
| 41 |
from mineru.utils.hash_utils import str_sha256
|
|
|
|
| 6 |
import re
|
| 7 |
import time
|
| 8 |
import zipfile
|
| 9 |
+
from loguru import logger
|
| 10 |
from pathlib import Path
|
| 11 |
|
| 12 |
os.system('pip uninstall -y mineru')
|
|
|
|
| 33 |
file.seek(0) # 将文件指针移回文件开始位置
|
| 34 |
file.truncate() # 截断文件,清除原有内容
|
| 35 |
json.dump(config, file, indent=4) # 写入新内容
|
| 36 |
+
except Exception as e:
|
| 37 |
+
logger.exception(e)
|
| 38 |
|
| 39 |
from gradio_pdf import PDF
|
| 40 |
import gradio as gr
|
|
|
|
| 41 |
|
| 42 |
from mineru.cli.common import prepare_env, read_fn, aio_do_parse
|
| 43 |
from mineru.utils.hash_utils import str_sha256
|