Skip to content

Commit

Permalink
Fix the bug that cannot adapt to the available model name.
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Sep 4, 2024
1 parent 7b515b4 commit 163e912
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,25 @@ def get_matching_providers(self, model_name, token):
# print("provider_rules", provider_rules)
for item in provider_rules:
for provider in config['providers']:
if provider['provider'] == item:
if "/" in item:
if item.split("/")[1] == model_name:
provider_list.append(provider)
else:
if model_name in provider['model'].keys():
# print("provider", provider, provider['provider'] == item, item)
if "/" in item:
if provider['provider'] == item.split("/")[0]:
if model_name in provider['model'].keys() and item.split("/")[1] == model_name:
provider_list.append(provider)
elif provider['provider'] == item:
if model_name in provider['model'].keys():
provider_list.append(provider)
else:
pass

# if provider['provider'] == item:
# if "/" in item:
# if item.split("/")[1] == model_name:
# provider_list.append(provider)
# else:
# if model_name in provider['model'].keys():
# provider_list.append(provider)

# import json
# for provider in provider_list:
# print(json.dumps(provider, indent=4, ensure_ascii=False))
Expand Down

0 comments on commit 163e912

Please sign in to comment.