Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public enum ModelType {
LLAVA_1_5,
LLAMA_GUARD_3,
QWEN_3,
SMOLLM_3,
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static String getSystemPromptTemplate(ModelType modelType) {
case LLAVA_1_5:
return "USER: ";
case QWEN_3:
case SMOLLM_3:
return "<|im_start|>system\n" + "You are a helpful assistant.\n" + "<|im_end|>\n";
default:
return SYSTEM_PLACEHOLDER;
Expand All @@ -45,6 +46,7 @@ public static String getUserPromptTemplate(ModelType modelType, boolean thinking
+ "<|start_header_id|>assistant<|end_header_id|>";

case QWEN_3:
case SMOLLM_3:
return "<|im_start|>user\n"
+ USER_PLACEHOLDER
+ "\n<|im_end|>\n"
Expand All @@ -68,6 +70,7 @@ public static String getConversationFormat(ModelType modelType) {
case LLAVA_1_5:
return USER_PLACEHOLDER + " ASSISTANT:";
case QWEN_3:
case SMOLLM_3:
return getUserPromptTemplate(modelType, false) + "<|im_end|>\n";
default:
return USER_PLACEHOLDER;
Expand All @@ -85,6 +88,8 @@ public static String getStopToken(ModelType modelType) {
return "</s>";
case QWEN_3:
return "<|endoftext|>";
case SMOLLM_3:
return "<|end_of_text|>";
default:
return "";
}
Expand All @@ -93,6 +98,7 @@ public static String getStopToken(ModelType modelType) {
public static String getThinkingModeToken(ModelType modelType, boolean thinkingMode) {
switch (modelType) {
case QWEN_3:
case SMOLLM_3:
return thinkingMode ? "" : "<think>\n\n</think>\n\n\n";
default:
return "";
Expand All @@ -102,6 +108,7 @@ public static String getThinkingModeToken(ModelType modelType, boolean thinkingM
public static String replaceSpecialToken(ModelType modelType, String token) {
switch (modelType) {
case QWEN_3:
case SMOLLM_3:
switch (token) {
case "<|im_end|>":
return "";
Expand Down
Loading