Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/openllm/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import re, typing, json
import pathlib, re, typing, json
import tabulate, questionary, typer

from openllm.accelerator_spec import can_run
Expand Down Expand Up @@ -160,6 +160,12 @@ def list_bento(
with open(path) as f:
origin_name = f.read().strip()
origin_path = path.parent / origin_name
if '..' in pathlib.PurePosixPath(origin_name).parts:
continue
try:
origin_path.resolve().relative_to(repo.path.resolve())
except ValueError:
continue
model = BentoInfo(alias=path.name, repo=repo, path=origin_path)
else:
model = None
Expand Down