def conceptual_captions_dataset(opt_init_steps=200, max_train_samples=1000, **kwargs):
    """Prepare a vision-text dataset for quantization."""
    dataset = load_dataset("google-research-datasets/conceptual_captions", trust_remote_code=True)
    model_path = kwargs.get("model_path")
    if not model_path:
        raise ValueError(
            "The 'model_path' parameter is required in data_configs.load_dataset_config but was not provided."
        )
    model = CLIPModel.from_pretrained(model_path)
    processor = CLIPProcessor.from_pretrained(model_path)
    max_length = model.config.text_config.max_position_embeddings
    train_dataset = dataset["train"].shuffle(seed=seed)
    collate_fn = wrap_collate_fn(processor, max_length)
    dataloader = torch.utils.data.DataLoader(train_dataset, collate_fn=collate_fn, batch_size=1)
    return prepare_calibration_data(dataloader, opt_init_steps)
Prepare a vision-text dataset for quantization.
examples/clip/openvino/user_script.py