Update bert_gen.py

This commit is contained in:
Stardust·减
2023-09-05 22:22:06 +08:00
committed by GitHub
parent ba3091241b
commit f8ebfe4273

View File

@@ -35,12 +35,9 @@ def process_line(line):
bert = torch.load(bert_path)
assert bert.shape[-1] == len(phone)
except Exception:
try:
bert = get_bert(text, word2ph, language_str,device)
assert bert.shape[-1] == len(phone)
torch.save(bert, bert_path)
except Exception:
print(text)
bert = get_bert(text, word2ph, language_str,device)
assert bert.shape[-1] == len(phone)
torch.save(bert, bert_path)
if __name__ == "__main__":