use pytorch to do resize and clip to reduce gpu memory usage.
Change resize_and_pad
to its original version as in molmo code so images are resized with pytorch utilities. Using tensorflow to resize image leads to large gpu memory increase, and the inference is impossible with 4090 24G, which is against the purpose of this project.
Can you double check the GitHub repository because my Pool requested did something similar was just accepted. It might be somewhat redundant with what you're trying to do or there could be some additional improvements.
@ctranslate2-4you Can you double check the GitHub repository because my Pool requested did something similar was just accepted. It might be somewhat redundant with what you're trying to do or there could be some additional improvements.
yeah, I just saw your change, I thought pull request in huggingface hub would make the process much easier for other people...(as people won't need to mannuly replace file).