Spaces:
Build error
Build error
mrq commited on
Commit ·
65fe304
1
Parent(s): 7b16b3e
fixed broken graph displaying
Browse files- src/utils.py +7 -5
src/utils.py
CHANGED
|
@@ -630,10 +630,12 @@ class TrainingState():
|
|
| 630 |
self.dataset_dir = f"./training/{self.config['name']}/finetune/"
|
| 631 |
self.batch_size = self.config['datasets']['train']['batch_size']
|
| 632 |
self.dataset_path = self.config['datasets']['train']['path']
|
|
|
|
|
|
|
| 633 |
|
| 634 |
self.its = self.config['train']['niter']
|
| 635 |
self.steps = 1
|
| 636 |
-
self.epochs =
|
| 637 |
self.checkpoints = int(self.its / self.config['logger']['save_checkpoint_freq'])
|
| 638 |
elif args.tts_backend == "vall-e":
|
| 639 |
self.batch_size = self.config['batch_size']
|
|
@@ -645,12 +647,12 @@ class TrainingState():
|
|
| 645 |
self.epochs = 1
|
| 646 |
self.checkpoints = 1
|
| 647 |
|
|
|
|
|
|
|
|
|
|
| 648 |
self.json_config = json.load(open(f"{self.config['data_root']}/train.json", 'r', encoding="utf-8"))
|
| 649 |
gpus = self.json_config['gpus']
|
| 650 |
|
| 651 |
-
with open(self.dataset_path, 'r', encoding="utf-8") as f:
|
| 652 |
-
self.dataset_size = len(f.readlines())
|
| 653 |
-
|
| 654 |
self.buffer = []
|
| 655 |
|
| 656 |
self.open_state = False
|
|
@@ -694,7 +696,7 @@ class TrainingState():
|
|
| 694 |
self.cmd = ['train.bat', config_path] if os.name == "nt" else ['./train.sh', config_path]
|
| 695 |
|
| 696 |
print("Spawning process: ", " ".join(self.cmd))
|
| 697 |
-
self.process = subprocess.Popen(self.cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
| 698 |
|
| 699 |
def parse_metrics(self, data):
|
| 700 |
if isinstance(data, str):
|
|
|
|
| 630 |
self.dataset_dir = f"./training/{self.config['name']}/finetune/"
|
| 631 |
self.batch_size = self.config['datasets']['train']['batch_size']
|
| 632 |
self.dataset_path = self.config['datasets']['train']['path']
|
| 633 |
+
with open(self.dataset_path, 'r', encoding="utf-8") as f:
|
| 634 |
+
self.dataset_size = len(f.readlines())
|
| 635 |
|
| 636 |
self.its = self.config['train']['niter']
|
| 637 |
self.steps = 1
|
| 638 |
+
self.epochs = int(self.its*self.batch_size/self.dataset_size)
|
| 639 |
self.checkpoints = int(self.its / self.config['logger']['save_checkpoint_freq'])
|
| 640 |
elif args.tts_backend == "vall-e":
|
| 641 |
self.batch_size = self.config['batch_size']
|
|
|
|
| 647 |
self.epochs = 1
|
| 648 |
self.checkpoints = 1
|
| 649 |
|
| 650 |
+
with open(self.dataset_path, 'r', encoding="utf-8") as f:
|
| 651 |
+
self.dataset_size = len(f.readlines())
|
| 652 |
+
|
| 653 |
self.json_config = json.load(open(f"{self.config['data_root']}/train.json", 'r', encoding="utf-8"))
|
| 654 |
gpus = self.json_config['gpus']
|
| 655 |
|
|
|
|
|
|
|
|
|
|
| 656 |
self.buffer = []
|
| 657 |
|
| 658 |
self.open_state = False
|
|
|
|
| 696 |
self.cmd = ['train.bat', config_path] if os.name == "nt" else ['./train.sh', config_path]
|
| 697 |
|
| 698 |
print("Spawning process: ", " ".join(self.cmd))
|
| 699 |
+
self.process = subprocess.Popen(self.cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
| 700 |
|
| 701 |
def parse_metrics(self, data):
|
| 702 |
if isinstance(data, str):
|