Skip to content

Commit

Permalink
🐛 Bug: Fix the bug when the model list is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Sep 6, 2024
1 parent f3ea9b1 commit 7477ff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ def get_matching_providers(self, model_name, token):
config = app.state.config
# api_keys_db = app.state.api_keys_db
api_list = app.state.api_list

api_index = api_list.index(token)
if not safe_get(config, 'api_keys', api_index, 'model'):
raise HTTPException(status_code=404, detail="No matching model found")
provider_rules = []

for model in config['api_keys'][api_index]['model']:
Expand Down

0 comments on commit 7477ff7

Please sign in to comment.