Skip to content

Commit

Permalink
Fix double assistant download procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Dec 18, 2019
1 parent 881465e commit 6c9a22d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/snips/SamkillaManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ def sync(self, skillFilter: dict = None, download: bool = True) -> bool:
self.log('Changes detected during sync but not downloading yet')
else:
self.log('No changes detected during sync')
self.SkillManager.onSnipsAssistantDownloaded(skillsInfos=skillFilter)

self.stop()
if not Path(self.Commons.rootDir(), f'trained/assistants/assistant_{self.LanguageManager.activeLanguage}').exists():
self.SnipsConsoleManager.doDownload()
else:
self.SkillManager.onSnipsAssistantDownloaded(skillsInfos=skillFilter)

if not Path(self.Commons.rootDir(), f'trained/assistants/assistant_{self.LanguageManager.activeLanguage}').exists():
self.SnipsConsoleManager.doDownload()
self.stop()

except AssistantNotFoundError:
self.log(f'Assistant project id \'{activeProjectId}\' for lang \'{activeLang}\' doesn\'t exist. Check your config.py')
Expand Down

0 comments on commit 6c9a22d

Please sign in to comment.