When using the deepseek-r1 model in Ollama, remove the content between the <think></think> tags.
This commit is contained in:
@@ -323,7 +323,11 @@ export const apiTranslate = async ({
|
||||
case OPT_TRANS_OLLAMA:
|
||||
case OPT_TRANS_OLLAMA_2:
|
||||
case OPT_TRANS_OLLAMA_3:
|
||||
if (res?.model.startsWith('deepseek-r1')) {
|
||||
trText = res?.response.replace(/<think>[\s\S]*<\/think>/i, '');
|
||||
}else{
|
||||
trText = res?.response;
|
||||
}
|
||||
isSame = text === trText;
|
||||
break;
|
||||
case OPT_TRANS_CUSTOMIZE:
|
||||
|
||||
Reference in New Issue
Block a user