yym68686 commited on
Commit
cb70818
·
unverified ·
2 Parent(s): 1808468 859400e

Merge pull request #18 from BenedictKing/main

Browse files
Files changed (1) hide show
  1. utils.py +4 -0
utils.py CHANGED
@@ -39,6 +39,8 @@ def update_initial_model(api_url, api):
39
  try:
40
  endpoint = BaseAPI(api_url=api_url)
41
  endpoint_models_url = endpoint.v1_models
 
 
42
  response = httpx.get(
43
  endpoint_models_url,
44
  headers={"Authorization": f"Bearer {api}"},
@@ -55,6 +57,8 @@ def update_initial_model(api_url, api):
55
  return models_id
56
  except Exception as e:
57
  print("error:", e)
 
 
58
  return []
59
 
60
  def update_config(config_data):
 
39
  try:
40
  endpoint = BaseAPI(api_url=api_url)
41
  endpoint_models_url = endpoint.v1_models
42
+ if isinstance(api, list):
43
+ api = api[0]
44
  response = httpx.get(
45
  endpoint_models_url,
46
  headers={"Authorization": f"Bearer {api}"},
 
57
  return models_id
58
  except Exception as e:
59
  print("error:", e)
60
+ import traceback
61
+ traceback.print_exc()
62
  return []
63
 
64
  def update_config(config_data):