Fixing predict docs (#16637)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Francesco Mattioli 2024-10-02 20:30:09 +02:00 committed by GitHub
parent bf51faeac5
commit c773f27653
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 19 deletions

View file

@ -183,9 +183,9 @@ class Exporter:
# Get the closest match if format is invalid
matches = difflib.get_close_matches(fmt, fmts, n=1, cutoff=0.6) # 60% similarity required to match
if closest_match:
if matches:
LOGGER.warning(f"WARNING ⚠️ Invalid export format='{fmt}', updating to format='{matches[0]}'")
fmt = closest_match[0]
fmt = matches[0]
else:
raise ValueError(f"Invalid export format='{fmt}'. Valid formats are {fmts}")
flags = [x == fmt for x in fmts]