diff --git a/ramalama/common.py b/ramalama/common.py index 2a1985eb..5950b79b 100644 --- a/ramalama/common.py +++ b/ramalama/common.py @@ -34,10 +34,15 @@ def available(cmd): return shutil.which(cmd) is not None -def exec_cmd(args): +def exec_cmd(args, stderr=True): if x: print(*args) + if not stderr: + # Redirecting stderr to /dev/null + with open(os.devnull, 'w') as devnull: + os.dup2(devnull.fileno(), sys.stderr.fileno()) + try: return os.execvp(args[0], args) except Exception: diff --git a/ramalama/model.py b/ramalama/model.py index 5e888051..97a62790 100644 --- a/ramalama/model.py +++ b/ramalama/model.py @@ -86,7 +86,6 @@ def run(self, args): "llama-cli", "-m", symlink_path, - "--log-disable", "--in-prefix", "", "--in-suffix", @@ -98,7 +97,7 @@ def run(self, args): if not args.ARGS: exec_args.append("-cnv") - exec_cmd(exec_args) + exec_cmd(exec_args, False) def serve(self, args): symlink_path = self.pull(args)