Пример #1
0
 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."
Пример #2
0
 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)
Пример #3
0
 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."
Пример #4
0
def factory(reload=True):
    config = AppConfig('test-resources/adult/adult.conf',
                       env={'app_root': '.'})
    fac = ImportConfigFactory(config, shared=True)
    return fac
Пример #5
0
def factory():
    config = AppConfig('test-resources/mnist/mnist.conf',
                       env={'app_root': '.'})
    fac = ImportConfigFactory(config, reload=False)
    return fac
Пример #6
0
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)
Пример #7
0
 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)
Пример #8
0
 def setUp(self):
     path = 'test-resources/transformer.conf'
     config = AppConfig(path)
     self.fac = ImportConfigFactory(config)
     self.vmng = self.fac.instance('feature_vectorizer_manager')