[feat] LlavaNext add feature size check to avoid CUDA Runtime Error (#33608)

* [feat] add feature size check to avoid CUDA Runtime Error

* [minor] add error handling to all llava models

* [minor] avoid nested if else

* [minor] add error message to Qwen2-vl and chameleon

* [fix] token dimension for check

* [minor] add feature dim check for videos too

* [fix] dimension check

* [fix] test reference values

---------

Co-authored-by: Raushan Turganbay <raushan@huggingface.co>
This commit is contained in:
laurentd-lunit
2024-10-15 23:19:18 +09:00
committed by GitHub
parent d00f1ca860
commit 0f49deacbf
11 changed files with 88 additions and 7 deletions

View File

@@ -118,8 +118,8 @@ class LlavaVisionText2TextModelTester:
self.batch_size = 3
self.num_channels = 3
self.image_size = 336
self.encoder_seq_length = 231
self.num_image_tokens = 224
self.encoder_seq_length = 232
self.num_image_tokens = 225
self.seq_length = seq_length + self.num_image_tokens
def get_config(self):