Skip to content

Commit

Permalink
update testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zRzRzRzRzRzRzR committed Aug 26, 2024
1 parent b538be3 commit adf65ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output/
*__pycache__/
samples*/
runs/
checkpoints/
master_ip
logs/
*.DS_Store
.idea
.idea
output*
2 changes: 1 addition & 1 deletion inference/cli_demo_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def generate_video(
text_encoder=text_encoder,
transformer=transformer,
vae=vae,
torch_dtype=torch.bfloat16,
torch_dtype=dtype,
)
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()
Expand Down
4 changes: 3 additions & 1 deletion sat/data_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def pad_last_frame(tensor, num_frames):
# T, H, W, C
if len(tensor) < num_frames:
pad_length = num_frames - len(tensor)
pad_tensor = torch.zeros([pad_length, *tensor.shape[1:]], dtype=tensor.dtype, device=tensor.device)
# Use the last frame to pad instead of zero
last_frame = tensor[-1]
pad_tensor = last_frame.unsqueeze(0).expand(pad_length, *tensor.shape[1:])
padded_tensor = torch.cat([tensor, pad_tensor], dim=0)
return padded_tensor
else:
Expand Down
2 changes: 1 addition & 1 deletion sat/inference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"

environs="WORLD_SIZE=1 RANK=0 LOCAL_RANK=0 LOCAL_WORLD_SIZE=1"

run_cmd="$environs python sample_video.py --base configs/cogvideox_2b.yaml configs/inference.yaml --seed $RANDOM"
run_cmd="$environs python sample_video.py --base configs/cogvideox_5b.yaml configs/inference.yaml --seed $RANDOM"

echo ${run_cmd}
eval ${run_cmd}
Expand Down

0 comments on commit adf65ff

Please sign in to comment.