Skip to content

Commit

Permalink
black formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Dec 6, 2024
1 parent 60c5a1d commit ce73643
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions egs/wenetspeech4tts/TTS/valle/valle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,9 +1670,7 @@ def visualize(
text_tokens = batch["text_tokens"].to("cpu").detach().numpy()
text_tokens_lens = batch["text_tokens_lens"].to("cpu").detach().numpy()
audio_features = batch["audio_features"].to("cpu").detach().numpy()
audio_features_lens = (
batch["audio_features_lens"].to("cpu").detach().numpy()
)
audio_features_lens = batch["audio_features_lens"].to("cpu").detach().numpy()
assert text_tokens.ndim == 2

utt_ids, texts = batch["utt_id"], batch["text"]
Expand All @@ -1681,9 +1679,7 @@ def visualize(
decoder_outputs = predicts[1]
if isinstance(decoder_outputs, list):
decoder_outputs = decoder_outputs[-1]
decoder_outputs = (
decoder_outputs.to("cpu").type(torch.float32).detach().numpy()
)
decoder_outputs = decoder_outputs.to("cpu").type(torch.float32).detach().numpy()

vmin, vmax = 0, 1024 # Encodec
if decoder_outputs.dtype == np.float32:
Expand Down

0 comments on commit ce73643

Please sign in to comment.