yangtb24 commited on
Commit
92a55e0
1 Parent(s): c2d5b17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -365,16 +365,17 @@ def get_all_models(api_key, sub_type):
365
  )
366
  return []
367
 
368
- def determine_request_type(model_name, model_list, free_model_list):
369
- """
370
- 根据用户请求的模型判断请求类型。
371
- """
372
- if model_name in free_model_list:
373
- return "free"
374
- elif model_name in model_list:
375
- return "paid"
 
376
  else:
377
- return "unknown"
378
 
379
  def select_key(request_type, model_name):
380
  """
 
365
  )
366
  return []
367
 
368
+ def determine_request_type(model_name, text_models, free_text_models, image_models, free_image_models):
369
+ if model_name in text_models:
370
+ return "text"
371
+ elif model_name in free_text_models:
372
+ return "free_text"
373
+ elif model_name in image_models:
374
+ return "image"
375
+ elif model_name in free_image_models:
376
+ return "free_image"
377
  else:
378
+ return None
379
 
380
  def select_key(request_type, model_name):
381
  """