From 7102bf32f0065bd52847bfdcf16b5be53d3d7217 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Tue, 23 May 2023 14:56:21 +0200 Subject: [PATCH] Fix GPU Cache --- default.gpu.env | 4 +++- llamabot.js | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/default.gpu.env b/default.gpu.env index 9abbb0d..8ddd571 100644 --- a/default.gpu.env +++ b/default.gpu.env @@ -51,4 +51,6 @@ REPEAT_PENALTY=1 GPU=1 -N_GPU_LAYERS=32 \ No newline at end of file +N_GPU_LAYERS=32 + +PYTHONUNBUFFERED=1 diff --git a/llamabot.js b/llamabot.js index 4766a2b..2015da6 100644 --- a/llamabot.js +++ b/llamabot.js @@ -347,6 +347,7 @@ async function generateResponse(conversation, message) { // if the message object doesn't exist, create it if (!botMessage) { (async () => { + //if (time == 0) return botMessage = await message.channel.send({ embeds: [embedData] }); })(); } else { @@ -408,10 +409,17 @@ async function generateResponse(conversation, message) { // if the message object doesn't exist, create it if (!botMessage) { (async () => { + //if (time == 0) return botMessage = await message.channel.send({ embeds: [embedData] }); })(); } else { - botMessage.edit({ embeds: [embedData] }); // otherwise, update the message + (async () => { + if (!isAnyConversationBusy()) { + botMessage.delete() + } else { + await botMessage.edit({ embeds: [embedData] }); // otherwise, update the message + } + })(); } }) }