Skip to content

Commit

Permalink
readme and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jul 23, 2024
1 parent 9cea0a0 commit f315bd2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ duration_predictor = DurationPredictor(
)
)

mel = torch.randn(2, 1024, 80)
mel = torch.randn(2, 1024, 100)
text = ['Hello', 'Goodbye']

loss = duration_predictor(mel, text = text)
Expand Down
4 changes: 1 addition & 3 deletions e2_tts_pytorch/e2_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,8 @@ def forward(
return x

max_seq_len = x.shape[1]
text_mask = text == -1

text = text + 1 # use 0 as filler token
text = text.masked_fill(text_mask, 0)
text = text + 1 # shift all other token ids up by 1 and use 0 as filler token

text = text[:, :max_seq_len] # just curtail if character tokens are more than the mel spec tokens, one of the edge cases the paper did not address
text = F.pad(text, (0, max_seq_len - text.shape[1]), value = 0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "e2-tts-pytorch"
version = "0.1.0"
version = "0.1.1"
description = "E2-TTS in Pytorch"
authors = [
{ name = "Phil Wang", email = "[email protected]" }
Expand Down

0 comments on commit f315bd2

Please sign in to comment.