yym68686 commited on
Commit
33bccc2
·
1 Parent(s): 27b85ef

🐛 Bug: Fix the bug of the model provider matching order error.

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -111,8 +111,8 @@ class ModelRequestHandler:
111
 
112
  provider_list = []
113
  # print("provider_rules", provider_rules)
114
- for provider in config['providers']:
115
- for item in provider_rules:
116
  if provider['provider'] in item:
117
  if "/" in item:
118
  if item.split("/")[1] == model_name:
@@ -129,6 +129,7 @@ class ModelRequestHandler:
129
 
130
  model_name = request.model
131
  matching_providers = self.get_matching_providers(model_name, token)
 
132
  # print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))
133
  if not matching_providers:
134
  raise HTTPException(status_code=404, detail="No matching model found")
 
111
 
112
  provider_list = []
113
  # print("provider_rules", provider_rules)
114
+ for item in provider_rules:
115
+ for provider in config['providers']:
116
  if provider['provider'] in item:
117
  if "/" in item:
118
  if item.split("/")[1] == model_name:
 
129
 
130
  model_name = request.model
131
  matching_providers = self.get_matching_providers(model_name, token)
132
+ # import json
133
  # print("matching_providers", json.dumps(matching_providers, indent=4, ensure_ascii=False))
134
  if not matching_providers:
135
  raise HTTPException(status_code=404, detail="No matching model found")