def prepare_calibration_data(dataloader, init_steps):
    """Prepare calibration data from a dataloader for a specified number of initialization steps.

    Iterate over the dataloader, fetching batches and storing the relevant data.
    """
    data = []
    with tqdm(total=init_steps) as pbar:
        for batch in dataloader:
            if len(data) == init_steps:
                break
            if batch:
                pbar.update(1)
                with torch.no_grad():
                    data.append(
                        {
                            "input_ids": batch["input_ids"].to("cpu"),
                            "pixel_values": batch["pixel_values"].to("cpu"),
                            "attention_mask": batch["attention_mask"].to("cpu"),
                        }
                    )
    return data
Prepare calibration data from a dataloader for a specified number of initialization steps.

    Iterate over the dataloader, fetching batches and storing the relevant data.
    
examples/clip/openvino/user_script.py