Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
PatBall1 committed Sep 16, 2024
1 parent 9061812 commit c9c6765
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion detectree2/models/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,11 @@ def get_latest_model_path(output_dir: str) -> str:
files = os.listdir(output_dir)

# Find all files that match the pattern and extract their indices
model_files = [(f, int(model_pattern.search(f).group(1))) for f in files if model_pattern.search(f)]
model_files = []
for f in files:
match = model_pattern.search(f)
if match:
model_files.append((f, int(match.group(1))))

if not model_files:
raise FileNotFoundError(f"No model files found in the directory {output_dir}")
Expand Down

0 comments on commit c9c6765

Please sign in to comment.