def setUp(self): path = self.CONFIG config = AppConfig(path) self.fac = ImportConfigFactory(config, shared=True) self.sent_text = 'I am a citizen of the United States of America.' self.def_parse = ('I', 'am', 'a', 'citizen', 'of', 'the United States of America', '.') self.sent_text2 = self.sent_text + " My name is Paul Landes."
def recreate_factory(self): if hasattr(self.__class__, 'CONF_FILE'): path = self.CONF_FILE env = {'app_root': '.'} self.config = AppEnvConfig(path, env=env) else: path = f'test-resources/{self.CONF}.conf' self.config = AppConfig(path) self.fac = ImportConfigFactory(self.config)
def setUp(self): if hasattr(self.__class__, 'CONF_FILE'): path = self.CONF_FILE else: path = 'test-resources/features.conf' config = AppConfig(path) self.fac = ImportConfigFactory(config, shared=True) self.sent_text = 'I am a citizen of the United States of America.' self.def_parse = ('I', 'am', 'a', 'citizen', 'of', 'the United States of America', '.') if not hasattr(self.__class__, 'NO_VECTORIZER'): self.vmng = self.fac.instance('feature_vectorizer_manager') self.sent_text2 = self.sent_text + " My name is Paul Landes."
def factory(reload=True): config = AppConfig('test-resources/adult/adult.conf', env={'app_root': '.'}) fac = ImportConfigFactory(config, shared=True) return fac
def factory(): config = AppConfig('test-resources/mnist/mnist.conf', env={'app_root': '.'}) fac = ImportConfigFactory(config, reload=False) return fac
def create_facade(*args, **kwargs) -> IrisModelFacade: Deallocatable.ALLOCATION_TRACKING = True config = AppConfig('test-resources/iris/iris.conf', env={'app_root': '.'}) return IrisModelFacade(config, *args, **kwargs)
def setUp(self): TorchConfig.init() config = AppConfig('test-resources/iris/iris.conf', env={'app_root': '.'}) self.config = config self.fac = ImportConfigFactory(config, shared=True, reload=False)
def setUp(self): path = 'test-resources/transformer.conf' config = AppConfig(path) self.fac = ImportConfigFactory(config) self.vmng = self.fac.instance('feature_vectorizer_manager')