KasumiCao commited on
Commit
38498cc
·
verified ·
1 Parent(s): 2697d4e

Clarify model service prerequisite for CLI and Python API

Browse files

Emphasize deploying and starting the OCR model service before running SDK examples.

Files changed (1) hide show
  1. README.md +13 -3
README.md CHANGED
@@ -139,6 +139,8 @@ To quickly try text-centric document understanding and structured information ex
139
 
140
  ### Use with the MiniCPM-OCR SDK
141
 
 
 
142
  Use the official `minicpm-ocr` SDK to parse a local image or PDF. It detects layout
143
  with PP-DocLayoutV3, recognises each region, and saves structured JSON and Markdown
144
  in reading order.
@@ -151,16 +153,21 @@ pip install "minicpm-ocr[all]"
151
 
152
  Install minicpm-ocr for your platform using the
153
  [installation guide](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_tutorial_en.md#1-set-up-the-sdk-environment).
154
- Before running the examples, start a compatible recognition service for
 
 
 
155
  `openbmb/MiniCPM-OCR-1.0` following the
156
  [deployment guide](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_tutorial_en.md#3-start-the-service).
157
  The examples assume a service at `http://127.0.0.1:8080`, served model name
158
  `minicpm-ocr`, and an NVIDIA GPU for layout detection. Match the endpoint, backend,
159
- and device to your deployment.
 
160
 
161
  #### CLI
162
 
163
- After starting the recognition service, save a local image as `demo.png` and run:
 
164
 
165
  ```bash
166
  minicpmvocr parse demo.png \
@@ -182,6 +189,9 @@ CPU layout detection. Run `minicpmvocr parse --help` for all CLI options.
182
 
183
  #### Python API
184
 
 
 
 
185
  Save a local image as `demo.png`, then run:
186
 
187
  ```python
 
139
 
140
  ### Use with the MiniCPM-OCR SDK
141
 
142
+ > **Required before using either the CLI or Python API:** deploy and start the OCR model service first, and wait until it is ready to accept requests. The SDK examples below are clients of that running service; they do not deploy or start the OCR model service automatically.
143
+
144
  Use the official `minicpm-ocr` SDK to parse a local image or PDF. It detects layout
145
  with PP-DocLayoutV3, recognises each region, and saves structured JSON and Markdown
146
  in reading order.
 
153
 
154
  Install minicpm-ocr for your platform using the
155
  [installation guide](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_tutorial_en.md#1-set-up-the-sdk-environment).
156
+
157
+ #### Prerequisite: deploy and start the model service
158
+
159
+ Before running either the CLI or Python API, deploy and start a vLLM recognition service for
160
  `openbmb/MiniCPM-OCR-1.0` following the
161
  [deployment guide](https://github.com/OpenBMB/MiniCPM-OCR/blob/main/docs/minicpm_ocr_tutorial_en.md#3-start-the-service).
162
  The examples assume a service at `http://127.0.0.1:8080`, served model name
163
  `minicpm-ocr`, and an NVIDIA GPU for layout detection. Match the endpoint, backend,
164
+ and device to your deployment. Configure the service to listen on port `8080`
165
+ and serve the model as `minicpm-ocr` to use the examples unchanged.
166
 
167
  #### CLI
168
 
169
+ **Start the model service described above and wait until it is ready before running this command.**
170
+ Save a local image as `demo.png`, then run:
171
 
172
  ```bash
173
  minicpmvocr parse demo.png \
 
189
 
190
  #### Python API
191
 
192
+ **The model service described above must already be running before you execute this Python example.**
193
+ Set `engine.server_url` and `engine.model_name` to match that service.
194
+
195
  Save a local image as `demo.png`, then run:
196
 
197
  ```python