Skip to content

Commit

Permalink
added cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberSahdev committed Jun 20, 2024
1 parent 511b42f commit a787620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ def send_user_request_from_ui_to_core(self) -> None:
else:
threading.Thread(target=self.core.execute_user_request, args=(user_request,), daemon=True).start()

def cleanup(self):
self.core.cleanup()


if __name__ == '__main__':
freeze_support() # As required by pyinstaller https://www.pyinstaller.org/en/stable/common-issues-and-pitfalls.html#multi-processing
app = App()
app.run()
app.cleanup()
sys.exit(0)
3 changes: 3 additions & 0 deletions app/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ def play_ding_on_completion(self):
# Play ding sound to signal completion
if self.settings_dict.get('play_ding_on_completion'):
print('\a')

def cleanup(self):
self.llm.cleanup()

0 comments on commit a787620

Please sign in to comment.