Merge pull request #219 from unclemcz/dev

fix:(Ollama)Remove the <think></think> tags in deepseek-r1.
This commit is contained in:
Gabe
2025-03-12 17:18:26 +08:00
committed by GitHub

View File

@@ -323,7 +323,11 @@ export const apiTranslate = async ({
case OPT_TRANS_OLLAMA: case OPT_TRANS_OLLAMA:
case OPT_TRANS_OLLAMA_2: case OPT_TRANS_OLLAMA_2:
case OPT_TRANS_OLLAMA_3: case OPT_TRANS_OLLAMA_3:
trText = res?.response; if (res?.model.startsWith('deepseek-r1')) {
trText = res?.response.replace(/<think>[\s\S]*<\/think>/i, '');
}else{
trText = res?.response;
}
isSame = text === trText; isSame = text === trText;
break; break;
case OPT_TRANS_CUSTOMIZE: case OPT_TRANS_CUSTOMIZE: