dodgy try except wrapper for creating kaldi files, to catch errors when retraining a model
@@ -57,6 +57,10 @@ class Model(FSObject):
with self.l2s_path.open(mode='wb') as fout:
fout.write(content)
+ def get_l2s_content(self):
+ with self.l2s_path.open(mode='r') as fin:
+ return fin.read()
+
@property
def status(self):
return self.config['status']
@@ -201,7 +205,7 @@ class Model(FSObject):
}
)
fout.write(content)
-
+ try:
# task copy-generated-files
output_path = self.path.joinpath('output')
output_path.mkdir(parents=True, exist_ok=True)
@@ -251,6 +255,8 @@ class Model(FSObject):
dst = f'{local_kaldi_path}'
shutil.copy(src, dst)
print('done.')
+ except:
+ print('couldnt prepare kaldi dirs')
def train():
local_kaldi_path = self.path.joinpath('kaldi')
