diff --git a/app/app.py b/app/app.py index f56edbd..c25e747 100644 --- a/app/app.py +++ b/app/app.py @@ -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) diff --git a/app/core.py b/app/core.py index 9f03411..d5b0dff 100644 --- a/app/core.py +++ b/app/core.py @@ -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()