[ProcessingIdefics] Attention mask bug with padding (#29449)

* Defaulted IdeficsProcessor padding to 'longest', removed manual padding

* make fixup

* Defaulted processor call to padding=False

* Add padding to processor call in IdeficsModelIntegrationTest as well

* Defaulted IdeficsProcessor padding to 'longest', removed manual padding

* make fixup

* Defaulted processor call to padding=False

* Add padding to processor call in IdeficsModelIntegrationTest as well

* redefaulted padding=longest again

* fixup/doc
This commit is contained in:
byi8220
2024-04-04 05:11:09 -04:00
committed by GitHub
parent 4e6c5eb045
commit 75b76a5ea4
3 changed files with 51 additions and 20 deletions

View File

@@ -656,7 +656,7 @@ class IdeficsModelIntegrationTest(TestCasePlus):
"HuggingFaceM4/idefics-9b", quantization_config=quantization_config, device_map="auto"
)
processor = self.default_processor
inputs = processor(prompts, return_tensors="pt").to(torch_device)
inputs = processor(prompts, return_tensors="pt", padding="longest").to(torch_device)
generated_ids = model.generate(**inputs, max_length=100)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)