@@ -23,14 +23,20 @@ def reduce_model_config(config: Any) -> Dict[str, Any]:
2323 config .vision_config .num_hidden_layers = min (
2424 config .vision_config .num_hidden_layers , 2
2525 )
26+ if hasattr (config .vision_config , "num_heads" ):
27+ config .vision_config .num_heads = min (config .vision_config .num_heads , 4 )
2628 if hasattr (config .vision_config , "image_size" ):
27- config .vision_config .image_size = min (config .vision_config .image_size , 96 )
29+ config .vision_config .image_size = min (config .vision_config .image_size , 168 // 2 )
2830 if hasattr (config .vision_config , "intermediate_size" ):
2931 config .vision_config .intermediate_size = min (
3032 config .vision_config .intermediate_size , 1076
3133 )
3234 if hasattr (config .vision_config , "patch_size" ):
33- config .vision_config .patch_size = min (config .vision_config .patch_size , 2 )
35+ config .vision_config .patch_size = min (config .vision_config .patch_size , 1 )
36+ if hasattr (config .vision_config , "temporal_patch_size" ):
37+ config .vision_config .temporal_patch_size = min (
38+ config .vision_config .temporal_patch_size , 8
39+ )
3440 if hasattr (config .vision_config , "hidden_size" ):
3541 config .vision_config .hidden_size = min (config .vision_config .hidden_size , 16 )
3642 if hasattr (config , "text_config" ):
0 commit comments