Skip to content

Commit

Permalink
detect non supported hybrid resnet-vit models in conversion script
Browse files Browse the repository at this point in the history
  • Loading branch information
staghado committed Nov 5, 2023
1 parent d5ce0e8 commit fcedbfd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transformers/models/vit/convert_vit_timm_to_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ def convert_vit_checkpoint(vit_name, pytorch_dump_folder_path):
):
raise ValueError(f"{vit_name} is not supported in transformers because it uses a layer scale in its blocks.")

# Hybrid ResNet-ViTs
if not isinstance(timm_model.patch_embed, timm.layers.PatchEmbed):
raise ValueError(f"{vit_name} is not supported in transformers because it is a hybrid ResNet-ViT.")

# non-overlapping position and class token embedding (to be added)

# get patch size and image size from the patch embedding submodule
Expand Down

0 comments on commit fcedbfd

Please sign in to comment.