def __call__(self): self.exit_function() # Passed in exit function site.setquit() # Restore default builtins exit() # Call builtin
import tflearn import random import pickle import json from root import PERSONMODEL, PERSONMODEL_TRAIN, PERSONMODEL_JSON, PERSONMODEL_LOG # restore all of our data structures stemmer = LancasterStemmer() data = pickle.load(open(PERSONMODEL_TRAIN, "rb")) words = data['words'] classes = data['classes'] train_x = data['train_x'] train_y = data['train_y'] import site site.setquit() # import our chat-bot intents file with open(PERSONMODEL_JSON) as json_data: intents = json.load(json_data) # Build neural network net = tflearn.input_data(shape=[None, len(train_x[0])]) net = tflearn.fully_connected(net, 8) net = tflearn.fully_connected(net, 8) net = tflearn.fully_connected(net, len(train_y[0]), activation='softmax') net = tflearn.regression(net) # Define models and setup tensorboard model = tflearn.DNN(net, tensorboard_dir=PERSONMODEL_LOG)
def update_event(self, inp=-1): self.set_output_val(0, site.setquit())