Signature
Parameters
Model architecture name. Must be a valid model from
list_models(). Examples: 'ViT-B-32', 'ViT-L-14', 'RN50'.Pretrained weights tag. Must be a valid tag for the specified model. Examples:
'openai', 'laion400m_e32', 'datacomp_xl_s13b_b90k'.Tag names are case-insensitive and hyphens/underscores are normalized (e.g., 'laion-400m-e32' and 'laion400m_e32' are equivalent).Returns
Pretrained configuration dictionary containing:
url: Direct download URL for weights (if available)hf_hub: Hugging Face Hub repository path (if available)mean: Image normalization mean values (tuple of 3 floats)std: Image normalization std values (tuple of 3 floats)interpolation: Image interpolation method ('bicubic','bilinear', etc.)resize_mode: Resize strategy ('shortest','squash','longest')quick_gelu: Whether model uses QuickGELU activation (bool, optional)
{} if model or tag not found.Example
Configuration Fields
Download Sources
- url: Direct HTTP(S) URL to download weights
- hf_hub: Hugging Face Hub path in format
org/repo/filenameororg/repo/
Preprocessing Parameters
-
mean: RGB channel means for normalization. Common values:
- OpenAI/CLIP:
(0.48145466, 0.4578275, 0.40821073) - SigLIP:
(0.5, 0.5, 0.5) - ImageNet:
(0.485, 0.456, 0.406)
- OpenAI/CLIP:
-
std: RGB channel standard deviations. Common values:
- OpenAI/CLIP:
(0.26862954, 0.26130258, 0.27577711) - SigLIP:
(0.5, 0.5, 0.5) - ImageNet:
(0.229, 0.224, 0.225)
- OpenAI/CLIP:
-
interpolation: Resizing interpolation method
'bicubic': Higher quality (default for most models)'bilinear': Faster'nearest': Fastest, lowest quality
-
resize_mode: How to handle aspect ratios
'shortest': Resize shortest edge, center crop (CLIP default)'squash': Resize to exact size, may distort (SigLIP default)'longest': Resize longest edge, center crop
Model-Specific
- quick_gelu: If True, model uses QuickGELU activation instead of standard GELU
Helper Functions
See Also
- list_pretrained - List all available model/tag combinations
- list_pretrained_tags_by_model - Get all tags for a specific model
- create_model - Create a model using these configurations
