The CLAPWrapper class is the primary interface for the CLAP model, supporting zero-shot classification, retrieval, and embedding extraction. You can initialize it by specifying a model file path and a version. If model_fp is not provided, the weights will be automatically downloaded from the microsoft/msclap repository on Hugging Face.
Supported versions:
'2022''2023''clapcap' (used for caption generation tasks)
from msclap import CLAPWrapper
from pathlib import Path
# Initialize with a specific version (e.g., '2023')
# If model_fp is None, it downloads automatically
wrapper = CLAPWrapper(model_fp=None, version='2023', use_cuda=True)