mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-10 01:05:33 +02:00
Update local.js
This commit is contained in:
parent
de91971518
commit
ff3af0e2e4
1 changed files with 1 additions and 3 deletions
|
@ -47,7 +47,6 @@ export class Local {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the model name includes "deepseek-r1" or "Andy-3.5-reasoning", then handle the <think> block.
|
// If the model name includes "deepseek-r1" or "Andy-3.5-reasoning", then handle the <think> block.
|
||||||
if (this.model_name && this.model_name.includes("deepseek-r1") || this.model_name.includes("andy-3.5:reasoning")) { // Fixed right here for deepsee-r1 and andy-3.5:reasoning
|
|
||||||
const hasOpenTag = res.includes("<think>");
|
const hasOpenTag = res.includes("<think>");
|
||||||
const hasCloseTag = res.includes("</think>");
|
const hasCloseTag = res.includes("</think>");
|
||||||
|
|
||||||
|
@ -61,7 +60,6 @@ export class Local {
|
||||||
if (hasOpenTag && hasCloseTag) {
|
if (hasOpenTag && hasCloseTag) {
|
||||||
res = res.replace(/<think>[\s\S]*?<\/think>/g, '');
|
res = res.replace(/<think>[\s\S]*?<\/think>/g, '');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
finalRes = res;
|
finalRes = res;
|
||||||
break; // Exit the loop if we got a valid response.
|
break; // Exit the loop if we got a valid response.
|
||||||
|
@ -69,7 +67,7 @@ export class Local {
|
||||||
|
|
||||||
if (finalRes == null) {
|
if (finalRes == null) {
|
||||||
console.warn("Could not get a valid <think> block or normal response after max attempts.");
|
console.warn("Could not get a valid <think> block or normal response after max attempts.");
|
||||||
finalRes = 'Response incomplete, please try again.';
|
finalRes = 'I thought too hard, sorry, try again.';
|
||||||
}
|
}
|
||||||
return finalRes;
|
return finalRes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue