ecker commited on
Commit
81eb58f
·
1 Parent(s): fda4715

show different losses, rewordings

Browse files
Files changed (2) hide show
  1. src/utils.py +18 -5
  2. src/webui.py +5 -3
src/utils.py CHANGED
@@ -482,10 +482,7 @@ class TrainingState():
482
  self.eta = "?"
483
  self.eta_hhmmss = "?"
484
 
485
- self.losses = {
486
- 'iteration': [],
487
- 'loss_gpt_total': []
488
- }
489
 
490
 
491
  self.load_losses()
@@ -522,8 +519,14 @@ class TrainingState():
522
 
523
  for k in infos:
524
  if 'loss_gpt_total' in infos[k]:
 
 
 
 
 
525
  self.losses['iteration'].append(int(k))
526
  self.losses['loss_gpt_total'].append(infos[k]['loss_gpt_total'])
 
527
 
528
  def cleanup_old(self, keep=2):
529
  if keep <= 0:
@@ -593,7 +596,7 @@ class TrainingState():
593
  except Exception as e:
594
  pass
595
 
596
- message = f'[{self.epoch}/{self.epochs}, {self.it}/{self.its}, {step}/{steps}] [{self.epoch_rate}, {self.it_rate}] [Loss at it {self.losses["iteration"][-1]}: {self.losses["loss_gpt_total"][-1]}] [ETA: {self.eta_hhmmss}]'
597
 
598
  if lapsed:
599
  self.epoch = self.epoch + 1
@@ -631,8 +634,18 @@ class TrainingState():
631
  if 'loss_gpt_total' in self.info:
632
  self.status = f"Total loss at epoch {self.epoch}: {self.info['loss_gpt_total']}"
633
 
 
 
 
 
 
 
 
 
 
634
  self.losses['iteration'].append(self.it)
635
  self.losses['loss_gpt_total'].append(self.info['loss_gpt_total'])
 
636
 
637
  verbose = True
638
  elif line.find('Saving models and training states') >= 0:
 
482
  self.eta = "?"
483
  self.eta_hhmmss = "?"
484
 
485
+ self.losses = []
 
 
 
486
 
487
 
488
  self.load_losses()
 
519
 
520
  for k in infos:
521
  if 'loss_gpt_total' in infos[k]:
522
+ # self.losses.append([ int(k), infos[k]['loss_text_ce'], infos[k]['loss_mel_ce'], infos[k]['loss_gpt_total'] ])
523
+ self.losses.append({ "iteration": int(k), "loss": infos[k]['loss_text_ce'], "type": "text_ce" })
524
+ self.losses.append({ "iteration": int(k), "loss": infos[k]['loss_mel_ce'], "type": "mel_ce" })
525
+ self.losses.append({ "iteration": int(k), "loss": infos[k]['loss_gpt_total'], "type": "gpt_total" })
526
+ """
527
  self.losses['iteration'].append(int(k))
528
  self.losses['loss_gpt_total'].append(infos[k]['loss_gpt_total'])
529
+ """
530
 
531
  def cleanup_old(self, keep=2):
532
  if keep <= 0:
 
596
  except Exception as e:
597
  pass
598
 
599
+ message = f'[{self.epoch}/{self.epochs}, {self.it}/{self.its}, {step}/{steps}] [{self.epoch_rate}, {self.it_rate}] [Loss at it {self.losses[-1]["iteration"]}: {self.losses[-1]["loss"]}] [ETA: {self.eta_hhmmss}]'
600
 
601
  if lapsed:
602
  self.epoch = self.epoch + 1
 
634
  if 'loss_gpt_total' in self.info:
635
  self.status = f"Total loss at epoch {self.epoch}: {self.info['loss_gpt_total']}"
636
 
637
+ self.losses.append({ "iteration": self.it, "loss": self.info['loss_text_ce'], "type": "text_ce" })
638
+ self.losses.append({ "iteration": self.it, "loss": self.info['loss_mel_ce'], "type": "mel_ce" })
639
+ self.losses.append({ "iteration": self.it, "loss": self.info['loss_gpt_total'], "type": "gpt_total" })
640
+ """
641
+ self.losses.append([int(k), self.info['loss_text_ce'], "loss_text_ce"])
642
+ self.losses.append([int(k), self.info['loss_mel_ce'], "loss_mel_ce"])
643
+ self.losses.append([int(k), self.info['loss_gpt_total'], "loss_gpt_total"])
644
+ """
645
+ """
646
  self.losses['iteration'].append(self.it)
647
  self.losses['loss_gpt_total'].append(self.info['loss_gpt_total'])
648
+ """
649
 
650
  verbose = True
651
  elif line.find('Saving models and training states') >= 0:
src/webui.py CHANGED
@@ -508,12 +508,14 @@ def setup_gradio():
508
  training_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
509
  verbose_training = gr.Checkbox(label="Verbose Console Output")
510
  training_buffer_size = gr.Slider(label="Console Buffer Size", minimum=4, maximum=32, value=8)
511
- training_keep_x_past_datasets = gr.Slider(label="Keep X Previous Datasets", minimum=0, maximum=8, value=0)
512
 
513
  training_loss_graph = gr.LinePlot(label="Loss Rates",
514
  x="iteration",
515
- y="loss_gpt_total",
516
  title="Loss Rates",
 
 
517
  width=600,
518
  height=350
519
  )
@@ -539,7 +541,7 @@ def setup_gradio():
539
  with gr.Column():
540
  exec_inputs = exec_inputs + [
541
  gr.Number(label="Sample Batch Size", precision=0, value=args.sample_batch_size),
542
- gr.Number(label="Concurrency Count", precision=0, value=args.concurrency_count),
543
  gr.Number(label="Output Sample Rate", precision=0, value=args.output_sample_rate),
544
  gr.Slider(label="Output Volume", minimum=0, maximum=2, value=args.output_volume),
545
  ]
 
508
  training_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
509
  verbose_training = gr.Checkbox(label="Verbose Console Output")
510
  training_buffer_size = gr.Slider(label="Console Buffer Size", minimum=4, maximum=32, value=8)
511
+ training_keep_x_past_datasets = gr.Slider(label="Keep X Previous States", minimum=0, maximum=8, value=0)
512
 
513
  training_loss_graph = gr.LinePlot(label="Loss Rates",
514
  x="iteration",
515
+ y="loss",
516
  title="Loss Rates",
517
+ color="type",
518
+ tooltip=['iteration', 'loss', 'type'],
519
  width=600,
520
  height=350
521
  )
 
541
  with gr.Column():
542
  exec_inputs = exec_inputs + [
543
  gr.Number(label="Sample Batch Size", precision=0, value=args.sample_batch_size),
544
+ gr.Number(label="Gradio Concurrency Count", precision=0, value=args.concurrency_count),
545
  gr.Number(label="Output Sample Rate", precision=0, value=args.output_sample_rate),
546
  gr.Slider(label="Output Volume", minimum=0, maximum=2, value=args.output_volume),
547
  ]