Fix the bug where the provider lookup is inaccurate.
Browse files
main.py
CHANGED
|
@@ -159,13 +159,16 @@ class ModelRequestHandler:
|
|
| 159 |
# print("provider_rules", provider_rules)
|
| 160 |
for item in provider_rules:
|
| 161 |
for provider in config['providers']:
|
| 162 |
-
if provider['provider']
|
| 163 |
if "/" in item:
|
| 164 |
if item.split("/")[1] == model_name:
|
| 165 |
provider_list.append(provider)
|
| 166 |
else:
|
| 167 |
if model_name in provider['model'].keys():
|
| 168 |
provider_list.append(provider)
|
|
|
|
|
|
|
|
|
|
| 169 |
return provider_list
|
| 170 |
|
| 171 |
async def request_model(self, request: RequestModel, token: str):
|
|
|
|
| 159 |
# print("provider_rules", provider_rules)
|
| 160 |
for item in provider_rules:
|
| 161 |
for provider in config['providers']:
|
| 162 |
+
if provider['provider'] == item:
|
| 163 |
if "/" in item:
|
| 164 |
if item.split("/")[1] == model_name:
|
| 165 |
provider_list.append(provider)
|
| 166 |
else:
|
| 167 |
if model_name in provider['model'].keys():
|
| 168 |
provider_list.append(provider)
|
| 169 |
+
# import json
|
| 170 |
+
# for provider in provider_list:
|
| 171 |
+
# print(json.dumps(provider, indent=4, ensure_ascii=False))
|
| 172 |
return provider_list
|
| 173 |
|
| 174 |
async def request_model(self, request: RequestModel, token: str):
|