Skip to content

Commit

Permalink
Merge pull request #18 from BenedictKing/main
Browse files Browse the repository at this point in the history
🐛 fix: api could be a list
  • Loading branch information
yym68686 authored Oct 13, 2024
2 parents 1808468 + 859400e commit cb70818
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def update_initial_model(api_url, api):
try:
endpoint = BaseAPI(api_url=api_url)
endpoint_models_url = endpoint.v1_models
if isinstance(api, list):
api = api[0]
response = httpx.get(
endpoint_models_url,
headers={"Authorization": f"Bearer {api}"},
Expand All @@ -55,6 +57,8 @@ def update_initial_model(api_url, api):
return models_id
except Exception as e:
print("error:", e)
import traceback
traceback.print_exc()
return []

def update_config(config_data):
Expand Down

0 comments on commit cb70818

Please sign in to comment.