def reload_config(): global settings settings = configurations.get_config() global match_info match_info = configurations.get_config(section="MATCH") global store store = configurations.get_config(section="STORE")
source_sample_matrix, source_char_aux, source_word_mask, samples=samples, config=config, model=search_model, data_stream=test_stream, normalize=config['normalized_bleu'])) # Initialize main loop logger.info("Initializing main loop") main_loop = MainLoop(model=training_model, algorithm=None, data_stream=None, extensions=extensions) for extension in main_loop.extensions: extension.main_loop = main_loop main_loop._run_extensions('before_training') logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) if __name__ == '__main__': # Get configurations for model configuration = configurations.get_config() logger.info("Model options:\n{}".format(pprint.pformat(configuration))) # Get data streams and call main main(configuration, get_test_stream(**configuration))
# Get the arguments parser = argparse.ArgumentParser() parser.add_argument("exp_config", help="Path to the yaml config file for your experiment") parser.add_argument( "-m", "--mode", default='train', help="The mode we are in [train,predict,server] -- default=train") parser.add_argument("--bokeh", default=False, action="store_true", help="Use bokeh server for plotting") # WORKING: move this to a separate method so we can call different modes from different threads if __name__ == "__main__": # Get configurations for model args = parser.parse_args() arg_dict = vars(args) configuration_file = arg_dict['exp_config'] mode = arg_dict['mode'] bokeh = args.bokeh logger.info('Running Neural Machine Translation in mode: {}'.format(mode)) config_obj = configurations.get_config(configuration_file) # add the config file name into config_obj config_obj['config_file'] = configuration_file logger.info("Model Configuration:\n{}".format(pprint.pformat(config_obj))) run(mode=mode, config_obj=config_obj, bokeh=bokeh)
import praw import time import requests import configurations import Stats import traceback import ScheduleManager as schedule from datetime import datetime, timedelta, timezone from PostTemplate import match_no_info from MatchData import Match from SimpleMatchData import SimpleMatch reddit = praw.Reddit('bot1') settings = configurations.get_config() match_info = configurations.get_config(section="MATCH") store = configurations.get_config(section="STORE") match = None attempt_count = 10 def start_up(): print("Iniciando Placar Futebot Mini...") global match if store["simplified_data"] == "True": match = SimpleMatch(match_info) else: match = Match(settings) while True: