Dataset & DataLoader¶
- class softs.SoftIterableDataset[source]¶
Infinite dataset yielding decoded tensor dicts.
Call
set_model(model_id)to switch models at any time. DataLoader workers detect the change and discard pending work.
- class softs.SoftDataLoader[source]¶
DataLoader with model switching support.
Usage:
loader = SoftDataLoader(model_id="teacher_v1", endpoint=ep.frontend, batch_config=config, medium_cls=ShmMedium, num_slots=8, batch_size=4) for batch in loader: train(batch) loader.set_model("teacher_v2") # switch the requested product id