[model] add dots ocr (#9176)

This commit is contained in:
Yaowei Zheng
2025-09-21 23:34:19 +08:00
committed by GitHub
parent 800934b507
commit 80fe3a172d
4 changed files with 45 additions and 3 deletions

View File

@@ -911,6 +911,23 @@ register_template(
)
register_template(
name="dots_ocr",
format_user=StringFormatter(slots=["<|user|>{{content}}<|endofuser|><|assistant|>"]),
format_assistant=StringFormatter(slots=["{{content}}<|endofassistant|>"]),
format_system=StringFormatter(slots=["<|system|>{{content}}<|endofsystem|>\n"]),
stop_words=["<|endofassistant|>"],
efficient_eos=True,
mm_plugin=get_mm_plugin(
name="qwen2_vl",
image_token="<|imgpad|>",
video_token="<|vidpad|>",
start_token="<|img|>",
end_token="<|endofimg|>",
),
)
register_template(
name="empty",
format_assistant=StringFormatter(slots=["{{content}}"]),