ecker commited on
Commit
c4b41e0
·
1 Parent(s): fefc7ab

properly placed the line toe xtract starting iteration

Browse files
Files changed (1) hide show
  1. src/utils.py +5 -6
src/utils.py CHANGED
@@ -482,6 +482,10 @@ def run_training(config_path, verbose=False, buffer_size=8, progress=gr.Progress
482
  if not training_started:
483
  if line.find('Start training from epoch') >= 0:
484
  training_started = True
 
 
 
 
485
  elif progress is not None:
486
  if line.find(' 0%|') == 0:
487
  open_state = True
@@ -496,12 +500,7 @@ def run_training(config_path, verbose=False, buffer_size=8, progress=gr.Progress
496
 
497
  progress(it / float(its), f'[{it}/{its}] {it_rate} Training... {status}')
498
 
499
- # it also says Start training from epoch, so it might be better to do that
500
- if line.find('INFO: Resuming training from epoch:') >= 0:
501
- match = re.findall(r'iter: ([\d,]+)', line)
502
- if match and len(match) > 0:
503
- it = int(match[0].replace(",", ""))
504
- elif line.find('INFO: [epoch:') >= 0:
505
  # easily rip out our stats...
506
  match = re.findall(r'\b([a-z_0-9]+?)\b: ([0-9]\.[0-9]+?e[+-]\d+)\b', line)
507
  if match and len(match) > 0:
 
482
  if not training_started:
483
  if line.find('Start training from epoch') >= 0:
484
  training_started = True
485
+
486
+ match = re.findall(r'iter: ([\d,]+)', line)
487
+ if match and len(match) > 0:
488
+ it = int(match[0].replace(",", ""))
489
  elif progress is not None:
490
  if line.find(' 0%|') == 0:
491
  open_state = True
 
500
 
501
  progress(it / float(its), f'[{it}/{its}] {it_rate} Training... {status}')
502
 
503
+ if line.find('INFO: [epoch:') >= 0:
 
 
 
 
 
504
  # easily rip out our stats...
505
  match = re.findall(r'\b([a-z_0-9]+?)\b: ([0-9]\.[0-9]+?e[+-]\d+)\b', line)
506
  if match and len(match) > 0: