Allow requiring GPU server
This commit is contained in:
parent
adfbeb815f
commit
1be3c51160
1 changed files with 6 additions and 1 deletions
|
@ -123,6 +123,11 @@ class AIModule(niobot.Module):
|
||||||
@niobot.command("ollama.chat", greedy=True)
|
@niobot.command("ollama.chat", greedy=True)
|
||||||
async def chat(self, ctx: niobot.Context):
|
async def chat(self, ctx: niobot.Context):
|
||||||
"""Chat with the model."""
|
"""Chat with the model."""
|
||||||
|
if "--gpu" in ctx.args:
|
||||||
|
ctx.args.remove("--gpu")
|
||||||
|
gpu_only = True
|
||||||
|
else:
|
||||||
|
gpu_only = False
|
||||||
try:
|
try:
|
||||||
message = " ".join(ctx.args)
|
message = " ".join(ctx.args)
|
||||||
users = self.read_users()
|
users = self.read_users()
|
||||||
|
@ -131,7 +136,7 @@ class AIModule(niobot.Module):
|
||||||
return
|
return
|
||||||
model = users[ctx.message.sender]
|
model = users[ctx.message.sender]
|
||||||
res = await ctx.respond("Finding server...")
|
res = await ctx.respond("Finding server...")
|
||||||
server = await self.find_server()
|
server = await self.find_server(gpu_only=gpu_only)
|
||||||
if not server:
|
if not server:
|
||||||
await res.edit(content="No servers available.")
|
await res.edit(content="No servers available.")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue