Replace **dtype** with **torch_dtype** in Model Loading

#19

The model card for Kosmos 2.5 has been updated to address an issue where the dtype parameter in the from_pretrained method was not functioning as intended. The code has been revised to use torch_dtype instead, aligning with the standard PyTorch API convention in Hugging Face's Transformers library. This change ensures proper data type specification during model loading and resolves issues with the previous dtype parameter.
The updated code is as follows:

model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo, device_map=device, torch_dtype=dtype)

This update does not alter the model's functionality but ensures compatibility with the Hugging Face Transformers API.

Additionally, I have submitted a pull request to update the Kosmos 2.5 README file documentation in the Hugging Face Transformers library to reflect this change: https://github.com/huggingface/transformers/pull/40529

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment