mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 13:00:39 +00:00
fix: convert back to model descriptor for model in list --downloaded
Signed-off-by: reidliu <reid201711@gmail.com>
This commit is contained in:
parent
34226d6c93
commit
d8c65cc771
1 changed files with 8 additions and 1 deletions
|
@ -19,6 +19,13 @@ def _get_model_size(model_dir):
|
|||
return sum(f.stat().st_size for f in Path(model_dir).rglob("*") if f.is_file())
|
||||
|
||||
|
||||
def _convert_to_model_descriptor(model):
|
||||
for m in all_registered_models():
|
||||
if model == m.descriptor().replace(":", "-"):
|
||||
return str(m.descriptor())
|
||||
return str(model)
|
||||
|
||||
|
||||
def _run_model_list_downloaded_cmd() -> None:
|
||||
headers = ["Model", "Size", "Modified Time"]
|
||||
|
||||
|
@ -30,7 +37,7 @@ def _run_model_list_downloaded_cmd() -> None:
|
|||
modified_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(abs_path)))
|
||||
rows.append(
|
||||
[
|
||||
model,
|
||||
_convert_to_model_descriptor(model),
|
||||
model_size,
|
||||
modified_time,
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue