mirror of
https://www.modelscope.cn/PaddlePaddle/PaddleOCR-VL.git
synced 2026-04-02 21:42:54 +08:00
update
This commit is contained in:
@ -7,14 +7,38 @@
|
||||
{%- if not sep_token is defined -%}
|
||||
{%- set sep_token = "<|end_of_sentence|>" -%}
|
||||
{%- endif -%}
|
||||
{%- if not image_token is defined -%}
|
||||
{%- set image_token = "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>" -%}
|
||||
{%- endif -%}
|
||||
{{- cls_token -}}
|
||||
{%- for message in messages -%}
|
||||
{%- if message["role"] == "user" -%}
|
||||
{{- "User: <|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>" + message["content"] + "\n" -}}
|
||||
{{- "User: " -}}
|
||||
{%- for content in message["content"] -%}
|
||||
{%- if content["type"] == "image" -%}
|
||||
{{ image_token }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- for content in message["content"] -%}
|
||||
{%- if content["type"] == "text" -%}
|
||||
{{ content["text"] }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{ "\n" -}}
|
||||
{%- elif message["role"] == "assistant" -%}
|
||||
{{- "Assistant: " + message["content"] + sep_token -}}
|
||||
{{- "Assistant: " -}}
|
||||
{%- for content in message["content"] -%}
|
||||
{%- if content["type"] == "text" -%}
|
||||
{{ content["text"] + "\n" }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{ sep_token -}}
|
||||
{%- elif message["role"] == "system" -%}
|
||||
{{- message["content"] -}}
|
||||
{%- for content in message["content"] -%}
|
||||
{%- if content["type"] == "text" -%}
|
||||
{{ content["text"] + "\n" }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
|
||||
Reference in New Issue
Block a user