8000 log · phecda-xu/PaddleDubbing@a697401 · GitHub
[go: up one dir, main page]

Skip to content

Commit a697401

Browse files
committed
log
1 parent 520f54d commit a697401

File tree

1 file changed

+17
-8
lines changed
  • src
    • < 8000 div class="PRIVATE_TreeView-item-visual prc-TreeView-TreeViewItemVisual-dRlGq" aria-hidden="true">
      transcribe.py

1 file changed

+17
-8
lines changed

src/transcribe.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ def _init_from_path(
325325
# must have phones_dict in acoustic
326326
self.phones_dict = os.path.join(
327327
am_res_path, pretrained_models[am_tag]['phones_dict'])
328-
print("self.phones_dict:", self.phones_dict)
328+
# print("self.phones_dict:", self.phones_dict)
329+
self.logger.info("self.phones_dict:{}".format(self.phones_dict))
329330
self.logger.info(am_res_path)
330331
self.logger.info(self.am_config)
331332
self.logger.info(self.am_ckpt)
@@ -335,7 +336,8 @@ def _init_from_path(
335336
self.am_stat = os.path.abspath(am_stat)
336337
self.phones_dict = os.path.abspath(phones_dict)
337338
self.am_res_path = os.path.dirname(os.path.abspath(self.am_config))
338-
print("self.phones_dict:", self.phones_dict)
339+
# print("self.phones_dict:", self.phones_dict)
340+
self.logger.info("self.phones_dict:{}".format(self.phones_dict))
339341

340342
# for speedyspeech
341343
self.tones_dict = None
@@ -383,21 +385,24 @@ def _init_from_path(
383385
with open(self.phones_dict, "r") as f:
384386
phn_id = [line.strip().split() for line in f.readlines()]
385387
vocab_size = len(phn_id)
386-
print("vocab_size:", vocab_size)
388+
# print("vocab_size:", vocab_size)
389+
self.logger.info("vocab_size:{}".format(vocab_size))
387390

388391
tone_size = None
389392
if self.tones_dict:
390393
with open(self.tones_dict, "r") as f:
391394
tone_id = [line.strip().split() for line in f.readlines()]
392395
tone_size = len(tone_id)
393-
print("tone_size:", tone_size)
396+
# print("tone_size:", tone_size)
397+
self.logger.info("tone_size:{}".format(tone_size))
394398

395399
spk_num = None
396400
if self.speaker_dict:
397401
with open(self.speaker_dict, 'rt') as f:
398402
spk_id = [line.strip().split() for line in f.readlines()]
399403
spk_num = len(spk_id)
400-
print("spk_num:", spk_num)
404+
# print("spk_num:", spk_num)
405+
self.logger.info("spk_num:{}".format(spk_num))
401406

402407
# frontend
403408
if lang == 'zh':
@@ -407,7 +412,8 @@ def _init_from_path(
407412

408413
elif lang == 'en':
409414
self.frontend = English(phone_vocab_path=self.phones_dict)
410-
print("frontend done!")
415+
# print("frontend done!")
416+
self.logger.info("frontend done!")
411417

412418
# acoustic model
413419
odim = self.am_config.n_mels
@@ -437,7 +443,8 @@ def _init_from_path(
437443
am_normalizer = ZScore(am_mu, am_std)
438444
self.am_inference = am_inference_class(am_normalizer, am)
439445
self.am_inference.eval()
440-
print("acoustic model done!")
446+
# print("acoustic model done!")
447+
self.logger.info("acoustic model done!")
441448

442449
# vocoder
443450
# model: {model_name}_{dataset}
@@ -455,7 +462,8 @@ def _init_from_path(
455462
voc_normalizer = ZScore(voc_mu, voc_std)
456463
self.voc_inference = voc_inference_class(voc_normalizer, voc)
457464
self.voc_inference.eval()
458-
print("voc done!")
465+
# print("voc done!")
466+
self.logger.info("voc done!")
459467

460468
def preprocess(self, input: Any, *args, **kwargs):
461469
"""
@@ -495,6 +503,7 @@ def infer(self,
495503
text, merge_sentences=merge_sentences)
496504
phone_ids = input_ids["phone_ids"]
497505
else:
506+
self.logger.error("lang should in {'zh', 'en'}!")
498507
raise ValueError("lang should in {'zh', 'en'}!")
499508

500509
flags = 0

0 commit comments

Comments
 (0)
0