MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS / collate_first_valid

Function collate_first_valid

moss_soundeffect_v2/diffsynth/trainers/utils.py:995–999  ·  view source on GitHub ↗
(batch)

Source from the content-addressed store, hash-verified

993def launch_data_process_task(model: DiffusionTrainingModule, dataset, cache_folder, num_shards: int = 16, skip_first_batches: int = 0, num_workers: int = 0, prefetch_factor: int = 4):
994 accelerator = Accelerator()
995 def collate_first_valid(batch):
996 for b in batch:
997 if b is not None:
998 return b
999 return {"__skip__": torch.tensor(True)}
1000 dataloader = torch.utils.data.DataLoader(
1001 dataset,
1002 # sampler=sampler,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected