mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Allow non-orca-mini on other hosts
This commit is contained in:
parent
8070fe497e
commit
0f03feeede
1 changed files with 12 additions and 11 deletions
|
@ -1899,25 +1899,16 @@ class OtherCog(commands.Cog):
|
||||||
|
|
||||||
content = None
|
content = None
|
||||||
RESTRICTED_SERVERS = (
|
RESTRICTED_SERVERS = (
|
||||||
"100.106.34.86:11434"
|
"100.106.34.86:11434",
|
||||||
|
"100.66.187.46:11434"
|
||||||
)
|
)
|
||||||
try_hosts = {
|
try_hosts = {
|
||||||
"127.0.0.1:11434": "localhost",
|
|
||||||
"100.106.34.86:11434": "NexTop",
|
"100.106.34.86:11434": "NexTop",
|
||||||
"ollama.shronk.net": "Alibaba Cloud",
|
"ollama.shronk.net": "Alibaba Cloud",
|
||||||
"100.66.187.46:11434": "NexBox",
|
"100.66.187.46:11434": "NexBox",
|
||||||
"100.116.242.161:11434": "PortaPi"
|
|
||||||
}
|
}
|
||||||
model = model.casefold()
|
model = model.casefold()
|
||||||
|
|
||||||
if not await self.bot.is_owner(ctx.author):
|
|
||||||
if not model.startswith("orca-mini"):
|
|
||||||
await ctx.respond(
|
|
||||||
":warning: You can only use `orca-mini` models.",
|
|
||||||
delete_after=30,
|
|
||||||
ephemeral=True
|
|
||||||
)
|
|
||||||
model = "orca-mini"
|
|
||||||
if server != "auto":
|
if server != "auto":
|
||||||
async with httpx.AsyncClient(follow_redirects=True) as client:
|
async with httpx.AsyncClient(follow_redirects=True) as client:
|
||||||
for host in try_hosts.keys():
|
for host in try_hosts.keys():
|
||||||
|
@ -1957,6 +1948,16 @@ class OtherCog(commands.Cog):
|
||||||
|
|
||||||
host = server
|
host = server
|
||||||
|
|
||||||
|
if host in RESTRICTED_SERVERS:
|
||||||
|
if not await self.bot.is_owner(ctx.author):
|
||||||
|
if not model.startswith("orca-mini"):
|
||||||
|
await ctx.respond(
|
||||||
|
":warning: You can only use `orca-mini` models.",
|
||||||
|
delete_after=30,
|
||||||
|
ephemeral=True
|
||||||
|
)
|
||||||
|
model = "orca-mini"
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
colour=discord.Colour.greyple()
|
colour=discord.Colour.greyple()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue