Merge pull request #12 from h1ddenpr0cess20/dev
improved model switching
This commit is contained in:
commit
835900c16b
@ -14,7 +14,8 @@ import asyncio
|
|||||||
class ollamarama:
|
class ollamarama:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
#load config file
|
#load config file
|
||||||
with open("config.json", "r") as f:
|
self.config_file = "config.json"
|
||||||
|
with open(self.config_file, "r") as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
@ -171,6 +172,10 @@ class ollamarama:
|
|||||||
if sender_display in self.admins:
|
if sender_display in self.admins:
|
||||||
#model switching
|
#model switching
|
||||||
if message.startswith(".model"):
|
if message.startswith(".model"):
|
||||||
|
with open(self.config_file, "r") as f:
|
||||||
|
config = json.load(f)
|
||||||
|
f.close()
|
||||||
|
self.models = config[0]['models']
|
||||||
if message == ".models":
|
if message == ".models":
|
||||||
current_model = f"Current model: {self.model.removeprefix('ollama/')}\nAvailable models: {', '.join(sorted(list(self.models)))}"
|
current_model = f"Current model: {self.model.removeprefix('ollama/')}\nAvailable models: {', '.join(sorted(list(self.models)))}"
|
||||||
await self.send_message(room_id, current_model)
|
await self.send_message(room_id, current_model)
|
||||||
|
Loading…
Reference in New Issue
Block a user