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}"`);