Skip to content

Commit

Permalink
Fix to get embedding set_alias to work
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Sep 4, 2023
1 parent ee61cb0 commit a54743f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,13 @@ def set_alias(alias, model_id_or_alias):
model = get_model(model_id_or_alias)
model_id = model.model_id
except UnknownModelError:
# Set the alias to the exact string they provided instead
model_id = model_id_or_alias
# Try to resolve it to an embedding model
try:
model = get_embedding_model(model_id_or_alias)
model_id = model.model_id
except UnknownModelError:
# Set the alias to the exact string they provided instead
model_id = model_id_or_alias
current[alias] = model_id
path.write_text(json.dumps(current, indent=4) + "\n")

Expand Down

0 comments on commit a54743f

Please sign in to comment.