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:
parent
fc6c66a4a4
commit
ec1d110689
7 changed files with 20 additions and 18 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue