Skip to content

Commit ba5983d

Browse files
authored
remove unnecessary output messages from smart_resize (#4702)
1 parent 031b761 commit ba5983d

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

paddlex/inference/genai/chat_templates/PaddleOCR-VL-0.9B.jinja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{%- if not cls_token is defined -%}
55
{%- set cls_token = "<|begin_of_sentence|>" -%}
66
{%- endif -%}
7-
{%- if not sep_token is defined -%}
8-
{%- set sep_token = "<|end_of_sentence|>" -%}
7+
{%- if not eos_token is defined -%}
8+
{%- set eos_token = "</s>" -%}
99
{%- endif -%}
1010
{%- if not image_token is defined -%}
1111
{%- set image_token = "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>" -%}
@@ -29,10 +29,10 @@
2929
{{- "Assistant: " -}}
3030
{%- for content in message["content"] -%}
3131
{%- if content["type"] == "text" -%}
32-
{{ content["text"] + "\n" }}
32+
{{ content["text"] }}
3333
{%- endif -%}
3434
{%- endfor -%}
35-
{{ sep_token -}}
35+
{{ eos_token -}}
3636
{%- elif message["role"] == "system" -%}
3737
{%- for content in message["content"] -%}
3838
{%- if content["type"] == "text" -%}

paddlex/inference/genai/models/paddleocr_vl_09b/_sglang/processor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ def smart_resize(
4545
4646
"""
4747
if height < factor:
48-
print(
49-
f"smart_resize: height={height} < factor={factor}, reset height=factor"
50-
)
5148
width = round((width * factor) / height)
5249
height = factor
5350

5451
if width < factor:
55-
print(f"smart_resize: width={width} < factor={factor}, reset width=factor")
5652
height = round((height * factor) / width)
5753
width = factor
5854

paddlex/inference/genai/models/paddleocr_vl_09b/_vllm.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,12 @@ def smart_resize(
103103
3. The aspect ratio of the image is maintained as closely as possible.
104104
105105
"""
106-
# if height < factor or width < factor:
107-
# raise ValueError(f"height:{height} or width:{width} must be larger than factor:{factor}")
108-
# if int(height < factor//4) + int(width < factor//4):
109-
# raise ValueError(f"height:{height} or width:{width} must be larger than factor:{factor//4}")
110106

111107
if height < factor:
112-
print(
113-
f"smart_resize: height={height} < factor={factor}, reset height=factor"
114-
)
115108
width = round((width * factor) / height)
116109
height = factor
117110

118111
if width < factor:
119-
print(f"smart_resize: width={width} < factor={factor}, reset width=factor")
120112
height = round((height * factor) / width)
121113
width = factor
122114

0 commit comments

Comments
 (0)