Skip to content

Commit c3aa315

Browse files
committed
llama-cli made a change
Now instead of --log-disable we need to redirect to stderr: ggml-org/llama.cpp#9418 Signed-off-by: Eric Curtin <ecurtin@redhat.com>
1 parent ab488f1 commit c3aa315

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ramalama/common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ def available(cmd):
3434
return shutil.which(cmd) is not None
3535

3636

37-
def exec_cmd(args):
37+
def exec_cmd(args, stderr=True):
3838
if x:
3939
print(*args)
4040

41+
if not stderr:
42+
# Replace the current process with a new one
43+
# Redirecting stderr to /dev/null
44+
with open(os.devnull, 'w') as devnull:
45+
os.dup2(devnull.fileno(), sys.stderr.fileno())
46+
4147
try:
4248
return os.execvp(args[0], args)
4349
except Exception:

ramalama/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def run(self, args):
8686
"llama-cli",
8787
"-m",
8888
symlink_path,
89-
"--log-disable",
9089
"--in-prefix",
9190
"",
9291
"--in-suffix",
@@ -98,7 +97,7 @@ def run(self, args):
9897
if not args.ARGS:
9998
exec_args.append("-cnv")
10099

101-
exec_cmd(exec_args)
100+
exec_cmd(exec_args, False)
102101

103102
def serve(self, args):
104103
symlink_path = self.pull(args)

0 commit comments

Comments
 (0)