Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prepare_dataset.py #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ def main(args):
vae = init_video_tokenizer(args.tokenizer_dir)

# Constants
t5_embeding_max_length = 512
t5_embedding_max_length = 512
chunk_duration = vae.video_vae.pixel_chunk_duration # Frames per chunk
cnt = 0 # File index

@@ -153,9 +153,9 @@ def main(args):
out = encode_for_batch(tokenizer, text_encoder, [args.prompt])[0]
encoded_text = torch.tensor(out, dtype=torch.bfloat16)

# Pad T5 embedding to t5_embeding_max_length
# Pad T5 embedding to t5_embedding_max_length
L, C_ = encoded_text.shape
t5_embed = torch.zeros(1, t5_embeding_max_length, C_, dtype=torch.bfloat16)
t5_embed = torch.zeros(1, t5_embedding_max_length, C_, dtype=torch.bfloat16)
t5_embed[0, :L] = encoded_text

# Save data to folder