Просмотр исходного кода

update core to use new brain loader class

nico 8 лет назад
Родитель
Сommit
8e165c1ced
2 измененных файлов с 4 добавлено и 2 удалено
  1. 2 1
      core/NeuronModule.py
  2. 2 1
      kalliope.py

+ 2 - 1
core/NeuronModule.py

@@ -66,7 +66,8 @@ class NeuronModule(object):
         logger.debug("NeuronModule called from class %s with parameters: %s" % (child_name, str(kwargs)))
 
         self.settings = SettingLoader.get_settings()
-        self.brain = BrainLoader.get_brain()
+        brain_loader = BrainLoader.Intance()
+        self.brain = brain_loader.brain
 
         # check if the user has overrider the TTS
         tts = kwargs.get('tts', None)

+ 2 - 1
kalliope.py

@@ -61,7 +61,8 @@ def main():
     if args.brain_file:
         brain_file = args.brain_file
     # load the brain once
-    brain = BrainLoader.get_brain(file_path=brain_file)
+    brain_loader = BrainLoader.Intance(file_path=brain_file)
+    brain = brain_loader.brain
 
     # check the user provide a valid action
     if args.action not in ACTION_LIST: