Update train.py

This commit is contained in:
nguentrungthat 2025-03-15 07:38:23 +07:00
parent fef22a3cf6
commit db1f306145
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ def get_latest_model(trained_model_folder: str, default_model: str = "train5/wei
# Lấy danh sách các thư mục theo ngày, loại bỏ thư mục của ngày hôm nay
subfolders = [
f for f in os.listdir(trained_model_folder)
if os.path.isdir(os.path.join(trained_model_folder, f)) and (f == today_str or f.startswith(today_str))
if os.path.isdir(os.path.join(trained_model_folder, f)) and (f <= today_str or f.startswith(today_str))
]
subfolders = sorted(subfolders, reverse=True) # Sắp xếp giảm dần (mới nhất trước)