Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

FastFlowLM
/
MiniCPM-OCR-1.0-NPU2

Image-Text-to-Text
MiniCPM-OCR
English
Chinese
minicpm_ocr
ocr
document-parsing
multimodal
vision-language
table-recognition
formula-recognition
conversational
Model card Files Files and versions
xet
Community

Instructions to use FastFlowLM/MiniCPM-OCR-1.0-NPU2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MiniCPM-OCR

    How to use FastFlowLM/MiniCPM-OCR-1.0-NPU2 with MiniCPM-OCR:

    pip install "minicpm-ocr[all]" huggingface_hub
    
    # Deploy FastFlowLM/MiniCPM-OCR-1.0-NPU2 as a recognition service before running the Python example:
    # https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/vllm_deploy_en.md
    # vLLM: load the model above; use --port 8080,
    # --served-model-name minicpm-ocr and --max-model-len 40960.
    # Layout detection uses cuda:0; recognition runs on the deployed service.
    from importlib.resources import files
    from pathlib import Path
    
    from minicpmvocr import load_config, pipelined_run
    from huggingface_hub import snapshot_download
    
    layout_model = snapshot_download("PaddlePaddle/PP-DocLayoutV3")
    cfg = load_config(
        str(files("minicpmvocr").joinpath("configs/minicpmvocr.yaml")),
        overrides={
            "input": {"file_path": str(Path("demo.png").resolve())},
            "engine": {
                "type": "vllm",
                "server_url": "http://127.0.0.1:8080",
                "model_name": "minicpm-ocr",
                "max_model_len": 40960,
            },
            "layout": {"model_dir": layout_model, "device": "cuda:0"},
            # Render PDFs in-process so this example also works without a main guard.
            "pipeline": {"overlap_layout": True, "render_workers": 1},
        },
    )
    pipelined_run(cfg)
  • Notebooks
  • Google Colab
  • Kaggle
MiniCPM-OCR-1.0-NPU2
2.01 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
FastFlowLM's picture
FastFlowLM
Update config.json file
fb25d49 verified 7 days ago
  • .gitattributes
    1.67 kB
    Upload 7 files 12 days ago
  • README.md
    13 kB
    Upload 7 files 12 days ago
  • chat_template.jinja
    7.34 kB
    Upload 7 files 12 days ago
  • config.json
    2.96 kB
    Update config.json file 7 days ago
  • model.q4nx
    1.07 GB
    xet
    Upload 7 files 12 days ago
  • tokenizer.json
    20 MB
    xet
    Upload 7 files 12 days ago
  • tokenizer_config.json
    1.54 kB
    Upload 7 files 12 days ago
  • vision_weight.q4nx
    925 MB
    xet
    Upload 7 files 12 days ago