Skip to content

Commit b69eb18

Browse files
committed
make sure when doing velocity consistency that base model only receives times from 0. to 1. - delta_time
1 parent 219adbd commit b69eb18

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "transfusion-pytorch"
3-
version = "0.1.11"
3+
version = "0.1.12"
44
description = "Transfusion in Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "lucidrains@gmail.com" }

transfusion_pytorch/transfusion.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,13 @@ def forward(
16471647

16481648
times_per_token = einsum(is_modalities.float(), times, 'b t m n, b m -> b t n')
16491649

1650+
# if needs velocity matching, make sure times are in the range of 0 - (1. - <velocity consistency delta time>)
1651+
1652+
if need_velocity_matching:
1653+
times_per_token = times_per_token * (1. - velocity_consistency_delta_time)
1654+
1655+
# noise only if returning loss
1656+
16501657
if return_loss:
16511658
noised_modality_tokens = []
16521659
flows = []

0 commit comments

Comments
 (0)