Skip to content

Commit d52ca22

Browse files
fix: DIA-1932: Error while estimating cost is displayed when user sav… (#355)
1 parent 857b2a8 commit d52ca22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: adala/utils/model_info_utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ def match_model_provider_string(model: str) -> str:
5555
lowercase_to_canonical_case = {
5656
k.lower(): k for k in litellm.models_by_provider[provider]
5757
}
58-
candidate_model_names = []
58+
candidate_model_names = set()
5959
for name in [model_name, normalize_canonical_model_name(model_name)]:
60-
candidate_model_names.append("/".join([provider, name.lower()]))
60+
candidate_model_names.add("/".join([provider, name.lower()]))
6161
# ...and Azure AI Foundry openai models are not listed there, but under Azure OpenAI
6262
if provider == "azure_ai":
63-
for model in candidate_model_names:
64-
candidate_model_names.append(model.replace("azure_ai/", "azure/"))
65-
matched_models = set(candidate_model_names) & set(lowercase_to_canonical_case)
63+
for model in candidate_model_names.copy():
64+
candidate_model_names.add(model.replace("azure_ai/", "azure/"))
65+
matched_models = candidate_model_names & set(lowercase_to_canonical_case)
6666
if len(matched_models) == 0:
6767
raise NoModelsFoundError(model)
6868
if len(matched_models) > 1:

0 commit comments

Comments
 (0)