yym68686 commited on
Commit
60e30aa
·
1 Parent(s): 1e9a2ac

🐛 Bug: Fix the bug where /v1/models does not work.

Browse files
Files changed (1) hide show
  1. utils.py +4 -2
utils.py CHANGED
@@ -225,7 +225,8 @@ def post_all_models(token, config, api_list):
225
  for provider_item in config["providers"]:
226
  if provider_item['provider'] != provider:
227
  continue
228
- for model_item in provider_item['model'].keys():
 
229
  if model_item not in unique_models:
230
  unique_models.add(model_item)
231
  model_info = {
@@ -240,7 +241,8 @@ def post_all_models(token, config, api_list):
240
  for provider_item in config["providers"]:
241
  if provider_item['provider'] != provider:
242
  continue
243
- for model_item in provider_item['model'].keys() :
 
244
  if model_item not in unique_models and model_item == model:
245
  unique_models.add(model_item)
246
  model_info = {
 
225
  for provider_item in config["providers"]:
226
  if provider_item['provider'] != provider:
227
  continue
228
+ model_dict = get_model_dict(provider_item)
229
+ for model_item in model_dict.keys():
230
  if model_item not in unique_models:
231
  unique_models.add(model_item)
232
  model_info = {
 
241
  for provider_item in config["providers"]:
242
  if provider_item['provider'] != provider:
243
  continue
244
+ model_dict = get_model_dict(provider_item)
245
+ for model_item in model_dict.keys() :
246
  if model_item not in unique_models and model_item == model:
247
  unique_models.add(model_item)
248
  model_info = {