Skip to content

Commit 5144760

Browse files
committed
make sure the meta train loop stops at a step that makes sense
1 parent ee33997 commit 5144760

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

TrainingInterfaces/Text_to_Spectrogram/ToucanTTS/toucantts_meta_train_loop.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def train_loop(net,
5454
"""
5555
net = net.to(device)
5656

57+
if steps % steps_per_checkpoint == 0:
58+
steps = steps + 1
59+
else:
60+
steps = steps + ((steps_per_checkpoint + 1) - (steps % steps_per_checkpoint)) # making sure to stop at the closest point that makes sense to the specified stopping point
61+
5762
style_embedding_function = StyleEmbedding().to(device)
5863
check_dict = torch.load(path_to_embed_model, map_location=device)
5964
style_embedding_function.load_state_dict(check_dict["style_emb_func"])

0 commit comments

Comments
 (0)