Skip to content

Commit e8a0d85

Browse files
committed
🔧 Fix 🐛 #109, don't call _build() if you want save into pb.
1 parent 84c0041 commit e8a0d85

File tree

2 files changed

+271
-1
lines changed

2 files changed

+271
-1
lines changed

notebooks/fastspeech2_inference.ipynb

+270
Large diffs are not rendered by default.

tensorflow_tts/models/fastspeech2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def _inference(
227227
duration_outputs = self.duration_predictor(
228228
[last_encoder_hidden_states, speaker_ids, attention_mask]
229229
) # [batch_size, length]
230-
duration_outputs = tf.math.exp(duration_outputs) - 1.0
230+
duration_outputs = tf.nn.relu(tf.math.exp(duration_outputs) - 1.0)
231231
duration_outputs = tf.cast(
232232
tf.math.round(duration_outputs * speed_ratios), tf.int32
233233
)

0 commit comments

Comments
 (0)