Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -3,7 +3,12 @@ license: mit
|
|
| 3 |
library_name: dots_ocr
|
| 4 |
pipeline_tag: image-text-to-text
|
| 5 |
tags:
|
|
|
|
| 6 |
- ocr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
language:
|
| 8 |
- en
|
| 9 |
- zh
|
|
@@ -861,7 +866,7 @@ This is an inhouse benchmark which contain 1493 pdf images with 100 languages.
|
|
| 861 |
<td>Nanonets OCR</td>
|
| 862 |
<td>67.0</td>
|
| 863 |
<td>68.6</td>
|
| 864 |
-
<td
|
| 865 |
<td>39.5</td>
|
| 866 |
<td>40.7</td>
|
| 867 |
<td>69.9</td>
|
|
@@ -1026,7 +1031,7 @@ pip install -e .
|
|
| 1026 |
### Download Model Weights
|
| 1027 |
> 💡**Note:** Please use a directory name without periods (e.g., `DotsOCR` instead of `dots.ocr`) for the model save path. This is a temporary workaround pending our integration with Transformers.
|
| 1028 |
```shell
|
| 1029 |
-
|
| 1030 |
```
|
| 1031 |
|
| 1032 |
|
|
@@ -1037,14 +1042,17 @@ The [Docker Image](https://hub.docker.com/r/rednotehilab/dots.ocr) is based on t
|
|
| 1037 |
|
| 1038 |
```shell
|
| 1039 |
# You need to register model to vllm at first
|
| 1040 |
-
|
|
|
|
| 1041 |
export PYTHONPATH=$(dirname "$hf_model_path"):$PYTHONPATH
|
| 1042 |
sed -i '/^from vllm\.entrypoints\.cli\.main import main$/a\
|
| 1043 |
-
from DotsOCR import modeling_dots_ocr_vllm' `which vllm`
|
| 1044 |
|
| 1045 |
# launch vllm server
|
| 1046 |
CUDA_VISIBLE_DEVICES=0 vllm serve ${hf_model_path} --tensor-parallel-size 1 --gpu-memory-utilization 0.95 --chat-template-content-format string --served-model-name model --trust-remote-code
|
| 1047 |
|
|
|
|
|
|
|
| 1048 |
# vllm api demo
|
| 1049 |
python3 ./demo/demo_vllm.py --prompt_mode prompt_layout_all_en
|
| 1050 |
```
|
|
|
|
| 3 |
library_name: dots_ocr
|
| 4 |
pipeline_tag: image-text-to-text
|
| 5 |
tags:
|
| 6 |
+
- image-to-text
|
| 7 |
- ocr
|
| 8 |
+
- document-parse
|
| 9 |
+
- layout
|
| 10 |
+
- table
|
| 11 |
+
- formula
|
| 12 |
language:
|
| 13 |
- en
|
| 14 |
- zh
|
|
|
|
| 866 |
<td>Nanonets OCR</td>
|
| 867 |
<td>67.0</td>
|
| 868 |
<td>68.6</td>
|
| 869 |
+
<td>77.7</td>
|
| 870 |
<td>39.5</td>
|
| 871 |
<td>40.7</td>
|
| 872 |
<td>69.9</td>
|
|
|
|
| 1031 |
### Download Model Weights
|
| 1032 |
> 💡**Note:** Please use a directory name without periods (e.g., `DotsOCR` instead of `dots.ocr`) for the model save path. This is a temporary workaround pending our integration with Transformers.
|
| 1033 |
```shell
|
| 1034 |
+
python3 tools/download_model.py
|
| 1035 |
```
|
| 1036 |
|
| 1037 |
|
|
|
|
| 1042 |
|
| 1043 |
```shell
|
| 1044 |
# You need to register model to vllm at first
|
| 1045 |
+
python3 tools/download_model.py
|
| 1046 |
+
export hf_model_path=./weights/DotsOCR # Path to your downloaded model weights, Please use a directory name without periods (e.g., `DotsOCR` instead of `dots.ocr`) for the model save path. This is a temporary workaround pending our integration with Transformers.
|
| 1047 |
export PYTHONPATH=$(dirname "$hf_model_path"):$PYTHONPATH
|
| 1048 |
sed -i '/^from vllm\.entrypoints\.cli\.main import main$/a\
|
| 1049 |
+
from DotsOCR import modeling_dots_ocr_vllm' `which vllm` # If you downloaded model weights by yourself, please replace `DotsOCR` by your model saved directory name, and remember to use a directory name without periods (e.g., `DotsOCR` instead of `dots.ocr`)
|
| 1050 |
|
| 1051 |
# launch vllm server
|
| 1052 |
CUDA_VISIBLE_DEVICES=0 vllm serve ${hf_model_path} --tensor-parallel-size 1 --gpu-memory-utilization 0.95 --chat-template-content-format string --served-model-name model --trust-remote-code
|
| 1053 |
|
| 1054 |
+
# If you get a ModuleNotFoundError: No module named 'DotsOCR', please check the note above on the saved model directory name.
|
| 1055 |
+
|
| 1056 |
# vllm api demo
|
| 1057 |
python3 ./demo/demo_vllm.py --prompt_mode prompt_layout_all_en
|
| 1058 |
```
|