Skip to content

Commit 0eff4e0

Browse files
committed
feat: trust remote code when loading autoconfig
1 parent 027341a commit 0eff4e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/multimodal/utils/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_vision_embeddings_size(model_id: str, num_patches: int) -> tuple[int, in
4848
"""Calculate vision embeddings size using model config and image processor
4949
Returns a tuple of (batch_size, num_patches, hidden_dim).
5050
"""
51-
config = AutoConfig.from_pretrained(model_id)
51+
config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
5252
assert num_patches > 0, "Number of patches must be positive"
5353
return 1, num_patches, getattr(config, "hidden_size", 4096)
5454

0 commit comments

Comments
 (0)