jhj0517 commited on
Commit
75ca5c9
·
1 Parent(s): 84ca156

Refactor file path function

Browse files
Files changed (1) hide show
  1. modules/utils/paths.py +1 -1
modules/utils/paths.py CHANGED
@@ -34,7 +34,7 @@ I18N_YAML_PATH = os.path.join(PROJECT_ROOT_DIR, "i18n", "translation.yaml")
34
 
35
 
36
  def get_auto_incremental_file_path(dir_path: str, extension: str, prefix: str = ""):
37
- counter = 0
38
  while True:
39
  if prefix:
40
  filename = f"{prefix}_{counter:05d}.{extension}"
 
34
 
35
 
36
  def get_auto_incremental_file_path(dir_path: str, extension: str, prefix: str = ""):
37
+ counter = len(os.listdir(dir_path))
38
  while True:
39
  if prefix:
40
  filename = f"{prefix}_{counter:05d}.{extension}"