multimodalart HF staff commited on
Commit
a48615d
1 Parent(s): 49bde08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -128,7 +128,8 @@ def download_file(url, filename, folder="."):
128
  response = requests.get(url, headers=headers)
129
  response.raise_for_status()
130
  except requests.exceptions.HTTPError as e:
131
- if api_key and response.status_code == 401:
 
132
  headers['Authorization'] = f'Bearer {os.environ["CIVITAI_API"]}'
133
  try:
134
  response = requests.get(url, headers=headers)
 
128
  response = requests.get(url, headers=headers)
129
  response.raise_for_status()
130
  except requests.exceptions.HTTPError as e:
131
+ print(e)
132
+ if response.status_code == 401:
133
  headers['Authorization'] = f'Bearer {os.environ["CIVITAI_API"]}'
134
  try:
135
  response = requests.get(url, headers=headers)