From f092e4db480a9b4bffa3a9fdb544902fa0347895 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 27 Jun 2024 00:50:21 +0100 Subject: [PATCH] Add second config check --- src/cogs/ollama.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 7fb5804..5223256 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -792,6 +792,27 @@ class Ollama(commands.Cog): key = os.urandom(6).hex() + if server_config.get("is_gpu", False) is False: + cf2 = ConfirmCPURun(ctx) + await ctx.edit( + content=None, + embed=discord.Embed( + title="Before you continue", + description="You've selected a CPU-only server. This will be really slow. This will also likely" + " bring the host to a halt. Consider the pain the CPU is about to endure. " + "Are you super" + " sure you want to continue? You can run `h!ollama-status` to see what servers are" + " available.", + color=discord.Color.red(), + ), + view=cf2 + ) + await cf2.wait() + if cf2.proceed is False: + return await ctx.edit("Cancelled.", embed=None, view=None) + else: + await ctx.edit(view=None) + embed = discord.Embed( title="Generating response...", description=">>> ",