cannot load the model with transformers
Hello,
Thank you for releasing moondream model. When I try to load the latest version of moondream2 with the recommended usage script, I am first getting "This modeling file requires the following packages that were not found in your environment: pyvips. Run pip install pyvips" error.
Once I install "pyvips", then I get another error: "OSError: cannot load library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libvips.so.42'".
I tried to load the model both on cpu and gpu (a single A100) but still the same issue. I do not have this issue with 'revision = "2024-08-26"'.
Any idea how to solve this issue? Thanks.
pip install pyvips-binary pyvips
pyvips requires the system to have libvips, but you can circumvent this by installing pyvips-binary which contains a statically compiled version of the library.
Same here! Won't work with revision 2025-01-09. Installed the dependencies you mentioned but this wasn't the trick. For me it loads the model and stucks with the vision encoder it seems. Revision 2024-08-26 works well and using moondream 0.0.6 with downloaded models works too but here the models performance isn't comparable to the gradio app in hf space / api use of moondream2. Maybe because it's int8?
Could you please help or clarify? What's wrong with transformers?
I tried it on a windows machine (Win11) and would go for another try in WSL.
Thanks a lot for your work- it's a great model and I am looking forward using this in education and hands-on lessons on e.g. RPi.
And also thanks for the free API usage! Great website, great work & very cool model. :)
@vikhyatk
I’m experiencing a similar issue. Since the update, I can’t load my previously saved and fine-tuned checkpoints created with revision 2024-08-26.
Initially, I installed pyvips-binary and pyvips, but now I’m encountering the following AttributeError:
module 'transformers_modules.vikhyatk.moondream2.fb2293ab7450beb1dae536b069f5966becf58e5c.moondream' has no attribute 'Moondream'
Here how i used to load them.
moondream = AutoModelForCausalLM.from_pretrained(
"checkpoints/moondream-ds_0.005-lr_0.001-bs_6-epoch_5",
trust_remote_code=True,
revision="2024-08-26",
device_map={"": DEVICE},
torch_dtype=DTYPE,
)
Thanks for the awesome model btw :) !
@vikhyatk
I also tested in WSL, but same behavior. It does not work with 25-01-09 and I cannot say why?
Setup tried also like shown here: https://www.youtube.com/watch?v=lH10BUmofNc
Many thanks to
@fahdmirzac
& maybe you can help?