Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,10 @@ os.system('cp magic-pdf.template.json ~/magic-pdf.json')
|
|
19 |
os.system(f"sed -i 's|/tmp/models|{model_dir}/models|g' /home/user/magic-pdf.json")
|
20 |
os.system("sed -i 's|cpu|cuda|g' /home/user/magic-pdf.json")
|
21 |
|
|
|
|
|
|
|
|
|
22 |
os.system("pip install gradio-pdf")
|
23 |
from gradio_pdf import PDF
|
24 |
|
@@ -158,8 +162,8 @@ def init_model():
|
|
158 |
return -1
|
159 |
|
160 |
|
161 |
-
model_init = init_model()
|
162 |
-
logger.info(f"model_init: {model_init}")
|
163 |
|
164 |
|
165 |
if __name__ == "__main__":
|
|
|
19 |
os.system(f"sed -i 's|/tmp/models|{model_dir}/models|g' /home/user/magic-pdf.json")
|
20 |
os.system("sed -i 's|cpu|cuda|g' /home/user/magic-pdf.json")
|
21 |
|
22 |
+
os.system('cp ch_PP-OCRv4_det_infer.tar /home/user/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_infer/ch_PP-OCRv4_det_infer.tar')
|
23 |
+
os.system('cp ch_PP-OCRv4_rec_infer.tar /home/user/.paddleocr/whl/rec/ch/ch_PP-OCRv4_rec_infer/ch_PP-OCRv4_rec_infer.tar')
|
24 |
+
os.system('cp ch_ppocr_mobile_v2.0_cls_infer.tar /home/user/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.tar')
|
25 |
+
|
26 |
os.system("pip install gradio-pdf")
|
27 |
from gradio_pdf import PDF
|
28 |
|
|
|
162 |
return -1
|
163 |
|
164 |
|
165 |
+
# model_init = init_model()
|
166 |
+
# logger.info(f"model_init: {model_init}")
|
167 |
|
168 |
|
169 |
if __name__ == "__main__":
|