Image-Text-to-Text
ONNX
ONNX Runtime GenAI
moonbox
onnxruntime
dots-ocr
dots-mocr
ocr
document-parsing
vision-language
Instructions to use moonbox-dev/dots.mocr-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ONNX Runtime GenAI
How to use moonbox-dev/dots.mocr-ONNX with ONNX Runtime GenAI:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download int8/chat_template.json from moonbox-dev/dots.mocr-ONNX: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/moonbox-dev/dots.mocr-ONNX/resolve/main/int8/chat_template.json
- Command line
-
hf download hf://moonbox-dev/dots.mocr-ONNX/int8/chat_template.json
-
curl -L -o chat_template.json https://huggingface.co/moonbox-dev/dots.mocr-ONNX/resolve/main/int8/chat_template.json
1.15 kB
| { | |
| "chat_template": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{%- for m in messages %}{%- if m.role == 'system' %}{{- '<|system|>' + m.content + '<|endofsystem|>\n' }}{%- elif m.role == 'user' %}{% if m.content is string %}{{- '<|user|>' + m.content + '<|endofuser|>' }}{% else %}{{- '<|user|>' }}{% for content in m.content %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|img|><|imgpad|><|endofimg|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|img|><|video_pad|><|endofimg|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}{{- '<|endofuser|>' }}{%- endif %}{%- elif m.role == 'assistant' %}{{- '<|assistant|>' + m.content }}{%- if not loop.last %}{{- '<|endofassistant|>' }}{%- endif %}{%- endif %}{%- endfor %}{%- if messages[-1].role != 'assistant' %}{{- '<|assistant|>' }}{%- endif %}" | |
| } |