def main(): ensure_pythonhashseed_set() if len(sys.argv) != 2: print('USAGE: server.py [config_file]') sys.exit(-1) config_file = sys.argv[1] serve(config_file)
def main(): ensure_pythonhashseed_set() if len(sys.argv) != 3: print('USAGE: server.py [port] [config_file]') print('RECEIVED: ' + ' '.join(sys.argv)) sys.exit(-1) port = int(sys.argv[1]) config_file = sys.argv[2] serve(port, config_file)
def main(): ensure_pythonhashseed_set() if len(sys.argv) != 3: print('USAGE: neighbor_search_api.py [port] [config_file]') print('RECEIVED: ' + ' '.join(sys.argv)) sys.exit(-1) port = int(sys.argv[1]) config_file = sys.argv[2] logging.basicConfig( format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', level=logging.INFO) serve(port, config_file)
model_type = get_choice(params, 'model_class', concrete_models.keys()) model_class = concrete_models[model_type] model = model_class(params) if model.can_train(): logger.info("Training model") model.train() else: logger.info( "Not enough training inputs. Assuming you wanted to load a model instead." ) # TODO(matt): figure out a way to specify which epoch you want to load a model from. model.load_model() def replace_none(dictionary): for key in dictionary.keys(): if dictionary[key] == "None": dictionary[key] = None elif isinstance(dictionary[key], pyhocon.config_tree.ConfigTree): dictionary[key] = replace_none(dictionary[key]) return dictionary if __name__ == "__main__": ensure_pythonhashseed_set() logging.basicConfig( format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', level=logging.INFO) main()
def test_pythonhashseed(): ensure_pythonhashseed_set()