Skip to content

Commit

Permalink
Merge pull request #187 from containers/log-disable
Browse files Browse the repository at this point in the history
llama-cli made a change
  • Loading branch information
rhatdan authored Sep 25, 2024
2 parents ab488f1 + 4210a6d commit 3ea3ec6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def run(self, args):
"llama-cli",
"-m",
symlink_path,
"--log-disable",
"--in-prefix",
"",
"--in-suffix",
Expand All @@ -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)
Expand Down

0 comments on commit 3ea3ec6

Please sign in to comment.