From 208e24b17e892eddd161e183a23e36d6c96340e0 Mon Sep 17 00:00:00 2001 From: jeffser Date: Wed, 22 May 2024 19:13:13 -0600 Subject: [PATCH] Added instance status messages (terminal) --- src/window.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7870f92..15c828d 100644 --- a/src/window.py +++ b/src/window.py @@ -855,6 +855,7 @@ class AlpacaWindow(Adw.ApplicationWindow): def start_instance(self): self.ollama_instance = subprocess.Popen(["/app/bin/ollama", "serve"], env={**os.environ, 'OLLAMA_HOST': f"127.0.0.1:{self.local_ollama_port}", "HOME": self.data_dir}, stderr=subprocess.PIPE, text=True) + print("Starting Alpaca's Ollama instance...") sleep(1) while True: err = self.ollama_instance.stderr.readline() @@ -862,9 +863,11 @@ class AlpacaWindow(Adw.ApplicationWindow): break if 'msg="inference compute"' in err: #Ollama outputs a line with this when it finishes loading, yeah break + print("Started Alpaca's Ollama instance") def stop_instance(self): self.ollama_instance.kill() + print("Stopped Alpaca's Ollama instance") def restart_instance(self): if self.ollama_instance is not None: self.stop_instance() @@ -881,8 +884,6 @@ class AlpacaWindow(Adw.ApplicationWindow): def connection_switched(self): new_value = self.remote_connection_switch.get_active() - - if new_value != self.run_remote: self.run_remote = new_value if self.run_remote: