Skip to content

Commit

Permalink
fix: try to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
numb3r3 committed Jan 2, 2024
1 parent f97b8bd commit 03bd11d
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions server/clip_server/model/pretrained_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,23 @@ def get_model_url_md5(name: str):
if len(model_pretrained) == 0: # not on s3
return None, None
else:
hg_download_url = (
_OPENCLIP_HUGGINGFACE_BUCKET
+ name.split('::')[0]
+ '/resolve/main/'
+ model_pretrained[0]
+ '?download=true'
)
try:
response = requests.head(hg_download_url)
if response.status_code in [200, 302]:
return (hg_download_url, model_pretrained[1])
else:
print(f'Model not found on hugging face, trying to download from s3.')
# hg_download_url = (
# _OPENCLIP_HUGGINGFACE_BUCKET
# + name.split('::')[0]
# + '/resolve/main/'
# + model_pretrained[0]
# + '?download=true'
# )
# try:
# response = requests.head(hg_download_url)
# if response.status_code in [200, 302]:
# return (hg_download_url, model_pretrained[1])
# else:
# print(f'Model not found on hugging face, trying to download from s3.')

except requests.exceptions.RequestException as e:
print(str(e))
print(f'Model not found on hugging face, trying to download from s3.')
# except requests.exceptions.RequestException as e:
# print(str(e))
# print(f'Model not found on hugging face, trying to download from s3.')
return (_OPENCLIP_S3_BUCKET + '/' + model_pretrained[0], model_pretrained[1])


Expand Down

0 comments on commit 03bd11d

Please sign in to comment.