Spaces:
Running on Zero
Running on Zero
iframe
#14
by myhloli - opened
Files changed (6)
- .gitattributes+1-8
- README.md+5-6
- app.pyDeleted-42
- index.htmlAdded+49
- packages.txtDeleted-2
- requirements.txtDeleted-2
31 unmodified lines323334353637383940414231 unmodified lines*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textexamples/demo1.docx filter=lfs diff=lfs merge=lfs -textexamples/demo1.docx filter=lfs diff=lfs merge=lfs -textexamples/demo1.pdf filter=lfs diff=lfs merge=lfs -textexamples/demo2.pdf filter=lfs diff=lfs merge=lfs -textexamples/docx_01.docx filter=lfs diff=lfs merge=lfs -textexamples/pptx_01.pptx filter=lfs diff=lfs merge=lfs -textexamples/small_ocr.pdf filter=lfs diff=lfs merge=lfs -textexamples/xlsx_01.xlsx filter=lfs diff=lfs merge=lfs -text31 unmodified lines3233343531 unmodified lines*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text
2 unmodified lines3456789101112131415161718192021222 unmodified linesemoji: 📚colorFrom: purplecolorTo: bluesdk: gradiosdk_version: 6.8.0app_file: app.pypinned: truelicense: apache-2.0python_version: 3.12models:- opendatalab/PDF-Extract-Kit-1.0- opendatalab/MinerU2.5-Pro-2605-1.2Bthumbnail: >-https://huggingface.co/proxy/cdn-uploads.huggingface.co/production/uploads/668f77a3b3991ac0c308a441/dsQTqtqf8SiM5oDe1FKFY.pngshort_description: Easy converting PDF and Office docs into Markdown and JSON---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-referencePaper: https://huggingface.co/papers/2409.188392 unmodified lines34567891011121314151617181920212 unmodified linesemoji: 📚colorFrom: purplecolorTo: bluesdk: staticapp_file: index.htmlpinned: truelicense: apache-2.0models:- opendatalab/PDF-Extract-Kit-1.0- opendatalab/MinerU2.5-Pro-2605-1.2Bthumbnail: >-https://huggingface.co/proxy/cdn-uploads.huggingface.co/production/uploads/668f77a3b3991ac0c308a441/dsQTqtqf8SiM5oDe1FKFY.pngshort_description: Embedded MinerU document extraction demofullWidth: true---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-referencePaper: https://huggingface.co/papers/2409.18839
123456789101112131415161718192021222324252627282930313233343536373839404142# Copyright (c) Opendatalab. All rights reserved.
import osimport jsonfrom loguru import logger
if __name__ == '__main__': os.system('pip uninstall -y mineru') os.system('pip install git+https://github.com/myhloli/Magic-PDF.git@dev') os.system('pip install -U mineru_vl_utils') os.system('pip uninstall -y onnxruntime') os.system('pip install onnxruntime-gpu==1.23.2') os.system('mineru-models-download -s huggingface -m all') # os.system('mineru-models-download -s modelscope -m all') os.environ['MINERU_MODEL_SOURCE'] = "local" os.environ['GRADIO_SSR_MODE'] = "false" os.environ['MINERU_PDF_RENDER_TIMEOUT'] = "10" try: home_dir = os.path.expanduser('~') config_file = os.path.join(home_dir, 'mineru.json') with open(config_file, 'r+') as file: config = json.load(file) delimiters = { 'display': {'left': '\\[', 'right': '\\]'}, 'inline': {'left': '\\(', 'right': '\\)'} } config['latex-delimiter-config'] = delimiters if os.getenv('apikey'): config['llm-aided-config']['title_aided']['api_key'] = os.getenv('apikey') config['llm-aided-config']['title_aided']['enable'] = True config['llm-aided-config']['title_aided']['model'] = "qwen3.5-flash" file.seek(0) # 将文件指针移回文件开始位置 file.truncate() # 截断文件,清除原有内容 json.dump(config, file, indent=4) # 写入新内容 except Exception as e: logger.exception(e) os.system('mineru-gradio --enable-api false --max-convert-pages 20 --latex-delimiters-type b --gpu-memory-utilization 0.5 --enable-vlm-preload true --client-side-output-generation true')12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849<!doctype html><html lang="zh-CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="color-scheme" content="light dark"> <title>MinerU Document Extraction Tools</title> <style> html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #ffffff; }
iframe { width: 100%; height: 100vh; min-height: 100vh; border: 0; display: block; }
noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1f2937; background: #ffffff; } </style> </head> <body> <iframe src="https://opendatalab-mineru.ms.show" title="MinerU Document Extraction Tools" allow="clipboard-read; clipboard-write; fullscreen" referrerpolicy="strict-origin-when-cross-origin" ></iframe> <noscript> 当前页面需要启用 JavaScript 才能加载 MinerU 文档提取演示。 </noscript> </body></html>12fonts-noto-corefonts-noto-cjk12mineru[core]>=3.2.0vllm==0.21.0.gitattributes+1-8
README.md+5-6
app.pyDeleted-42
index.htmlAdded+49
packages.txtDeleted-2
requirements.txtDeleted-2