diff --git a/src/models/huggingface.js b/src/models/huggingface.js index ab74f24..59dd0f7 100644 --- a/src/models/huggingface.js +++ b/src/models/huggingface.js @@ -51,7 +51,6 @@ export class HuggingFace { } // If the model is DeepSeek-R1, check for mismatched blocks. - if (this.model_name && this.model_name.toLowerCase().includes("deepseek-r1")) { const hasOpenTag = res.includes(""); const hasCloseTag = res.includes(""); @@ -65,7 +64,6 @@ export class HuggingFace { if (hasOpenTag && hasCloseTag) { res = res.replace(/[\s\S]*?<\/think>/g, '').trim(); } - } finalRes = res; break; // Exit loop if we got a valid response. @@ -74,7 +72,7 @@ export class HuggingFace { // If no valid response was obtained after max attempts, assign a fallback. if (finalRes == null) { console.warn("Could not get a valid block or normal response after max attempts."); - finalRes = 'Response incomplete, please try again.'; + finalRes = 'I thought too hard, sorry, try again.'; } console.log('Received.'); console.log(finalRes); @@ -84,4 +82,4 @@ export class HuggingFace { async embed(text) { throw new Error('Embeddings are not supported by HuggingFace.'); } -} \ No newline at end of file +}