test weights: check hash of pre-downloaded weights

This commit is contained in:
Cédric Deltheil 2024-03-26 14:39:12 +00:00 committed by Cédric Deltheil
parent 04daeced73
commit 2345f01dd3

View file

@ -96,8 +96,10 @@ def download_file(
print(f"{skip_icon} {response.status_code} ERROR {readable_size:<8} {url}")
return
if skip_existing and os.path.exists(dest_filename):
if skip_existing and is_downloaded:
print(f"{skip_icon} Skipping previously downloaded {url}")
if expected_hash is not None:
check_hash(dest_filename, expected_hash)
return
os.makedirs(dest_folder, exist_ok=True)