fix: repo update; client

This commit is contained in:
bojiang
2024-07-05 17:15:42 +08:00
parent e05daf657e
commit d2e02f8998
2 changed files with 3 additions and 3 deletions

View File

@@ -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:

View File

@@ -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():