Skip to content
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
6 changes: 6 additions & 0 deletions packages/ltx-trainer/scripts/process_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import json
import os
import gc
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -332,6 +333,11 @@ def compute_captions_embeddings( # noqa: PLR0913

logger.info(f"Processed {len(dataset):,} captions. Embeddings saved to {output_path}")

if device.startswith("cuda"):
del text_encoder
gc.collect()
torch.cuda.empty_cache()


@app.command()
def main( # noqa: PLR0913
Expand Down