mirror of
https://github.com/containers/ramalama.git
synced 2026-02-05 06:46:39 +01:00
Add colors to "ramalama serve" if we can
I don't notice any difference but a lot of things are LOG_INFO in llama.cpp Signed-off-by: Eric Curtin <ecurtin@redhat.com>
This commit is contained in:
@@ -50,6 +50,11 @@ with the default RamaLama
|
||||
$(error)s"""
|
||||
|
||||
|
||||
def should_colorize():
|
||||
t = os.getenv("TERM")
|
||||
return t and t != "dumb" and sys.stdout.isatty()
|
||||
|
||||
|
||||
def is_split_file_model(model_path):
|
||||
"""returns true if ends with -%05d-of-%05d.gguf"""
|
||||
return bool(re.match(SPLIT_MODEL_RE, model_path))
|
||||
@@ -533,6 +538,9 @@ class Model(ModelBase):
|
||||
else:
|
||||
exec_args += ["--jinja"]
|
||||
|
||||
if should_colorize():
|
||||
exec_args += ["--log-colors"]
|
||||
|
||||
exec_args += [
|
||||
"--alias",
|
||||
self.model,
|
||||
|
||||
Reference in New Issue
Block a user