-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcall.py
More file actions
27 lines (22 loc) · 679 Bytes
/
Copy pathcall.py
File metadata and controls
27 lines (22 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from insaneintents import GenericAssistant
import dotenv
import os
dotenv.load_dotenv()
modname = os.getenv("MODELNAME")
assistant = GenericAssistant('intents/intents.json', model_name=modname)
def start(train=True):
if train:
assistant.train_model()
assistant.save_model()
else:
assistant.load_model()
done = False
def get(message, uname=None, cname=modname.capitalize()):
x = str(eval('f"'+str(assistant.request(message))+'"'))
return x
def cli():
"Talk to the model in CLI, re-trains model before initialising CLI"
while not done:
m = input("IN@AINA<< :: ")
res = get(m,uname="InSaiyan")
print(res)