ultralytics 8.1.33 fix HUB model checks (#9153)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Kalen Michael 2024-03-24 06:14:15 +01:00 committed by GitHub
parent fc6c66a4a4
commit ec1d110689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 20 additions and 18 deletions

View file

@ -315,7 +315,7 @@ def check_font(font="Arial.ttf"):
# Download to USER_CONFIG_DIR if missing
url = f"https://ultralytics.com/assets/{name}"
if downloads.is_url(url):
if downloads.is_url(url, check=True):
downloads.safe_download(url=url, file=file)
return file
@ -498,7 +498,7 @@ def check_file(file, suffix="", download=True, hard=True):
raise FileNotFoundError(f"'{file}' does not exist")
elif len(files) > 1 and hard:
raise FileNotFoundError(f"Multiple files match '{file}', specify exact path: {files}")
return files[0] if len(files) else [] # return file
return files[0] if len(files) else [] if hard else file # return file
def check_yaml(file, suffix=(".yaml", ".yml"), hard=True):