def main(): args = add_args() hutoma = EasyHutoma(args.user_key) aiid = args.aiid if not aiid: # get the list of available AIs ais = hutoma.list_ai() print 'AIs list: {0}'.format(ais) if len(ais) == 0: print 'No AIs is available...' return aiid = ais[0] print 'AI id: {0}'.format(aiid) print 'Training monitor (check every {0} secs):'.format(args.sleep) while True: response, _ = hutoma.current_status(aiid) print '\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}'.format(**response) print '\tScore: {score:s}'.format(**response) print '\tAIid: {0}'.format(aiid) if response.get('trainingStatus ', -1) < 3: print 'Training ended...' break time.sleep(args.sleep) print 'API calls: {0}'.format(hutoma.api_calls_count())
def main(): args = add_args() hutoma = EasyHutoma(args.user_key) aiid = args.aiid if not aiid: # get the list of available AIs ais = hutoma.list_ai() print 'AIs list: {0}'.format(ais) if len(ais) == 0: print 'No AIs is available...' return aiid = ais[0] print 'AI id: {0}'.format(aiid) print 'Training monitor (check every {0} secs):'.format(args.sleep) while True: response, _ = hutoma.current_status(aiid) print '\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}'.format( **response) print '\tScore: {score:s}'.format(**response) print '\tAIid: {0}'.format(aiid) if response.get('trainingStatus ', -1) < 3: print 'Training ended...' break time.sleep(args.sleep) print 'API calls: {0}'.format(hutoma.api_calls_count())
def main(): args = add_args() hutoma = EasyHutoma(args.user_key) input = raw_input( 'Attention! this will delete all existing AIs (type "quit" to exit): ') if 'quit' in input: return # get the list of available AIs ais = hutoma.list_ai() print 'AIs list: {0}'.format(ais) for ai in ais: print 'deleting {0}...'.format(ai) hutoma.delete_ai(ai) ais = hutoma.create_ai() print 'New AI created: {0}'.format(ais) aiid = ais[0] print 'AI id: {0}'.format(aiid) print 'Upload data files...' hutoma.training_upload_files(aiid, args.source_file, args.target_file) print 'Training monitor (check every {0} secs):'.format(args.sleep) print 'Start training...' start_time = time.time() response, _ = hutoma.training_start(aiid) print '\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}'.format( **response) print '\tScore: {score:s}'.format(**response) print '\tAIid: {0}'.format(aiid) while response.get('trainingStatus ', -1) < 3: time.sleep(args.sleep) response, _ = hutoma.current_status(aiid) print print '\n\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}'.format( **response) print '\tScore: {score:s}'.format(**response) print '\tAIid: {0}'.format(aiid) print '{0} secs to train'.format(int(time.time() - start_time)) print 'API calls: {0}'.format(hutoma.api_calls_count())
def main(): args = add_args() hutoma = EasyHutoma(args.user_key) input = raw_input('Attention! this will delete all existing AIs (type "quit" to exit): ') if "quit" in input: return # get the list of available AIs ais = hutoma.list_ai() print "AIs list: {0}".format(ais) for ai in ais: print "deleting {0}...".format(ai) hutoma.delete_ai(ai) ais = hutoma.create_ai() print "New AI created: {0}".format(ais) aiid = ais[0] print "AI id: {0}".format(aiid) print "Upload data files..." hutoma.training_upload_files(aiid, args.source_file, args.target_file) print "Training monitor (check every {0} secs):".format(args.sleep) print "Start training..." start_time = time.time() response, _ = hutoma.training_start(aiid) print "\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}".format(**response) print "\tScore: {score:s}".format(**response) print "\tAIid: {0}".format(aiid) while response.get("trainingStatus ", -1) < 3: time.sleep(args.sleep) response, _ = hutoma.current_status(aiid) print print "\n\tStatus: {trainingStatusDetails:s}\n\tRuntime status: {runtimeStatusDetails:s}".format(**response) print "\tScore: {score:s}".format(**response) print "\tAIid: {0}".format(aiid) print "{0} secs to train".format(int(time.time() - start_time)) print "API calls: {0}".format(hutoma.api_calls_count())