Update README_zh.md
Browse files- README_zh.md +42 -0
README_zh.md
CHANGED
|
@@ -310,6 +310,48 @@ if __name__ == "__main__":
|
|
| 310 |
print(markdowns[0])
|
| 311 |
```
|
| 312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
- **提取视觉区域的 HTML 图像标签**
|
| 314 |
|
| 315 |
```python
|
|
|
|
| 310 |
print(markdowns[0])
|
| 311 |
```
|
| 312 |
|
| 313 |
+
- **vllm cli**
|
| 314 |
+
|
| 315 |
+
```bash
|
| 316 |
+
# use modelscope
|
| 317 |
+
export VLLM_USE_MODELSCOPE=true
|
| 318 |
+
|
| 319 |
+
vllm serve anyforge/Flame-OCR \
|
| 320 |
+
--served-model-name "flame-ocr" \
|
| 321 |
+
--tensor-parallel-size 1 \
|
| 322 |
+
--gpu-memory-utilization 0.8 \
|
| 323 |
+
--gdn-prefill-backend triton \
|
| 324 |
+
--max-model-len 16384 \
|
| 325 |
+
--temperature 0.0 \
|
| 326 |
+
--max-num-seqs 1 \
|
| 327 |
+
--enable-chunked-prefill \
|
| 328 |
+
--max-num-batched-tokens 16384
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
curl http://localhost:8000/v1/chat/completions \
|
| 332 |
+
-H "Content-Type: application/json" \
|
| 333 |
+
-d '{
|
| 334 |
+
"model": "flame-ocr",
|
| 335 |
+
"messages": [
|
| 336 |
+
{
|
| 337 |
+
"role": "user",
|
| 338 |
+
"content": [
|
| 339 |
+
{"type": "image_url", "image_url": {"url": "file:///path/to/test.jpg"}},
|
| 340 |
+
{"type": "text", "text": "\nExtract all readable content from the image in natural human reading order and output the result as a single Markdown document. For charts or images, represent them using an HTML image tag: <' + 'img src="images/bbox_{left}_{top}_{right}_{bottom}.jpg" />, where left, top, right, bottom are bounding box coordinates scaled to [0, 1000). Format formulas as LaTeX. Format tables as HTML: <table>...</table>. Transcribe all other text as standard Markdown. Preserve the original text without translation or paraphrasing."}
|
| 341 |
+
]
|
| 342 |
+
}
|
| 343 |
+
],
|
| 344 |
+
"max_tokens": 16384,
|
| 345 |
+
"temperature": 0.0,
|
| 346 |
+
"mm_processor_kwargs": {
|
| 347 |
+
"images_kwargs": {
|
| 348 |
+
"min_pixels": 448 * 448,
|
| 349 |
+
"max_pixels": 2880 * 2880
|
| 350 |
+
}
|
| 351 |
+
}
|
| 352 |
+
}'
|
| 353 |
+
```
|
| 354 |
+
|
| 355 |
- **提取视觉区域的 HTML 图像标签**
|
| 356 |
|
| 357 |
```python
|