Skip to content

Commit

Permalink
Update bert_gen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardust-minus authored Sep 30, 2023
1 parent 9587a63 commit 81ce0cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bert_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def process_line(line):

bert_path = wav_path.replace(".wav", ".bert.pt")

try:
bert = torch.load(bert_path)
assert bert.shape[-1] == len(phone)
except Exception:
bert = get_bert(text, word2ph, language_str, device)
assert bert.shape[-1] == len(phone)
torch.save(bert, bert_path)
#try:
#bert = torch.load(bert_path)
#assert bert.shape[-1] == len(phone)
#except Exception:
bert = get_bert(text, word2ph, language_str, device)
assert bert.shape[-1] == len(phone)
torch.save(bert, bert_path)


if __name__ == "__main__":
Expand Down

0 comments on commit 81ce0cc

Please sign in to comment.