File tree Expand file tree Collapse file tree 3 files changed +4
-16
lines changed Expand file tree Collapse file tree 3 files changed +4
-16
lines changed Original file line number Diff line number Diff line change 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|>" -%}
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" -%}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments