yym68686 commited on
Commit
a80a859
·
1 Parent(s): 9790e2d

💻 Code: Add log display for model not found.

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -879,7 +879,7 @@ async def get_right_order_providers(request_model, config, api_index, scheduling
879
  matching_providers = get_matching_providers(request_model, config, api_index)
880
 
881
  if not matching_providers:
882
- raise HTTPException(status_code=404, detail="No matching model found")
883
 
884
  num_matching_providers = len(matching_providers)
885
  if app.state.channel_manager.cooldown_period > 0 and num_matching_providers > 1:
@@ -947,10 +947,10 @@ class ModelRequestHandler:
947
  api_list = app.state.api_list
948
  api_index = api_list.index(token)
949
 
 
950
  if not safe_get(config, 'api_keys', api_index, 'model'):
951
- raise HTTPException(status_code=404, detail="No matching model found")
952
 
953
- request_model = request.model
954
  scheduling_algorithm = safe_get(config, 'api_keys', api_index, "preferences", "SCHEDULING_ALGORITHM", default="fixed_priority")
955
 
956
  matching_providers = await get_right_order_providers(request_model, config, api_index, scheduling_algorithm)
 
879
  matching_providers = get_matching_providers(request_model, config, api_index)
880
 
881
  if not matching_providers:
882
+ raise HTTPException(status_code=404, detail=f"No matching model found: {request_model}")
883
 
884
  num_matching_providers = len(matching_providers)
885
  if app.state.channel_manager.cooldown_period > 0 and num_matching_providers > 1:
 
947
  api_list = app.state.api_list
948
  api_index = api_list.index(token)
949
 
950
+ request_model = request.model
951
  if not safe_get(config, 'api_keys', api_index, 'model'):
952
+ raise HTTPException(status_code=404, detail=f"No matching model found: {request_model}")
953
 
 
954
  scheduling_algorithm = safe_get(config, 'api_keys', api_index, "preferences", "SCHEDULING_ALGORITHM", default="fixed_priority")
955
 
956
  matching_providers = await get_right_order_providers(request_model, config, api_index, scheduling_algorithm)