Skip to content
Merged
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 @@ -90,6 +90,7 @@ public void onResult(String result) {
if (result.equals(PromptFormat.getStopToken(mCurrentSettingsFields.getModelType()))) {
return;
}
result = PromptFormat.replaceSpecialToken(mCurrentSettingsFields.getModelType(), result);
if (result.equals("\n\n") || result.equals("\n")) {
if (!mResultMessage.getText().isEmpty()) {
mResultMessage.appendText(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ public static String getThinkingModeToken(ModelType modelType, boolean thinkingM
}
}

public static String replaceSpecialToken(ModelType modelType, String token) {
switch (modelType) {
case QWEN_3:
switch (token) {
case "<|im_end|>":
return "";
case "<think>":
return "Thinking...\n";
case "</think>":
return "\nDone thinking";
}
default:
return token;
}
}

public static String getLlavaPresetPrompt() {
return "A chat between a curious human and an artificial intelligence assistant. The assistant"
+ " gives helpful, detailed, and polite answers to the human's questions. USER: ";
Expand Down
Loading