Skip to content

Commit c49558f

Browse files
committed
Reorder fields in Qwen3ChatFormat, remove redundant line breaks, and fix formatting for improved readability and consistency.
1 parent dfb3a4b commit c49558f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/com/example/model/format/Qwen3ChatFormat.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@
1212
*/
1313
public class Qwen3ChatFormat implements ChatFormat {
1414

15-
protected Qwen3Tokenizer tokenizer;
16-
protected ChatTokens chatTokens;
17-
1815
protected final int beginOfText;
1916
protected final int startHeader;
2017
protected final int endHeader;
2118
protected final int endOfTurn;
2219
protected final int endOfText;
2320
protected final int endOfMessage;
2421
protected final int endOfTextFim;
25-
2622
protected final int imStart; // beginOfText
2723
protected final int imEnd; // endOfText
28-
2924
protected final int fimPrefix;
3025
protected final int fimSuffix;
3126
protected final int fimMiddle;
27+
protected Qwen3Tokenizer tokenizer;
28+
protected ChatTokens chatTokens;
3229

3330
public Qwen3ChatFormat(Qwen3Tokenizer tokenizer, ChatTokens chatTokens) {
3431
this.tokenizer = tokenizer;
@@ -106,15 +103,12 @@ public int getBeginOfText() {
106103
return beginOfText;
107104
}
108105

109-
110-
111106
@Override
112107
public Set<Integer> getStopTokens() {
113108
if (imEnd == -1 && endOfText == -1) {
114109
throw new IllegalStateException("No stop token is defined.");
115110
}
116111
if (imEnd == -1) {
117-
118112
return Set.of(endOfText);
119113
}
120114
return Set.of(imEnd, endOfText, endOfTextFim);

0 commit comments

Comments
 (0)