From 03bd11d0c5e81f5a3adcb80a2332793d448fa9ea Mon Sep 17 00:00:00 2001 From: "felix.wang" Date: Tue, 2 Jan 2024 14:33:51 +0800 Subject: [PATCH] fix: try to fix test --- server/clip_server/model/pretrained_models.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/server/clip_server/model/pretrained_models.py b/server/clip_server/model/pretrained_models.py index 9e5c3fca..bde9cc6a 100644 --- a/server/clip_server/model/pretrained_models.py +++ b/server/clip_server/model/pretrained_models.py @@ -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])