mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-04-29 03:13:44 -04:00
fix: repo update; client
This commit is contained in:
@@ -85,7 +85,7 @@ async def _run_model(
|
||||
|
||||
from openai import AsyncOpenAI
|
||||
|
||||
client = AsyncOpenAI(base_url=f"http://localhost:{port}/v1")
|
||||
client = AsyncOpenAI(base_url=f"http://localhost:{port}/v1", api_key="local")
|
||||
model_id = (await client.models.list()).data[0].id
|
||||
while True:
|
||||
try:
|
||||
|
||||
@@ -50,7 +50,6 @@ def _complete_alias(repo_name: str):
|
||||
from openllm_next.model import list_bento
|
||||
|
||||
for bento in list_bento(repo_name=repo_name):
|
||||
path = bento.path
|
||||
alias = bento.labels.get("openllm_alias", "").strip()
|
||||
if alias:
|
||||
for a in alias.split(","):
|
||||
@@ -81,7 +80,6 @@ def update():
|
||||
depth=1,
|
||||
branch=repo.branch,
|
||||
)
|
||||
_complete_alias(repo_name)
|
||||
output("")
|
||||
output(f"Repo `{repo.name}` updated", style="green")
|
||||
except:
|
||||
@@ -110,6 +108,8 @@ def update():
|
||||
output(f"Removed unused repo cache {c}")
|
||||
with open(REPO_DIR / "last_update", "w") as f:
|
||||
f.write(datetime.datetime.now().isoformat())
|
||||
for repo_name in config.repos:
|
||||
_complete_alias(repo_name)
|
||||
|
||||
|
||||
def ensure_repo_updated():
|
||||
|
||||
Reference in New Issue
Block a user