Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve AttributeError by utilizing device calculation at the start o…
…f the forward function (huggingface#27347) This commit addresses the 'NoneType' object AttributeError within the IdeficsModel forward function. Previously, the 'device' attribute was accessed directly from input_ids, resulting in a potential 'NoneType' error. Now, the device is properly calculated at the beginning of the forward function and utilized consistently throughout, ensuring the 'image_hidden_states' are derived from the correct device. This modification enables smoother processing and compatibility, ensuring the correct device attribution for 'image_encoder_embeddings' in the IdeficsModel forward pass.
- Loading branch information