From d5b15727403caa2c7e67710be365a8c67bd45877 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Tue, 18 Oct 2022 19:43:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ai/huggingface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai/huggingface.ts b/src/ai/huggingface.ts index db37dc9..9acc09d 100644 --- a/src/ai/huggingface.ts +++ b/src/ai/huggingface.ts @@ -81,7 +81,7 @@ class HuggingFaceAI { const ctx = this.memory.slice(this.memoryLen * -2); const prompt = `${this.prefix}\n${ctx.join("\n")}\n${username}: "${message}"\n${this.name}: "`; const res = await this.#query(prompt); - const botMsg = res[0].generated_text.split(/"[.?!\n]?/gm)[0]; + const botMsg = res[0].generated_text.split(/"[.?!]?\n/gm)[0]; this.memory.push(`${username}: "${message}"`); this.memory.push(`${this.name}: "${botMsg}"`); console.log(`${this.name}: "${botMsg}"`);