-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generate is a function but it can get loaded as a module in a "corner" case. #26
Comments
What OS are you running this notebook on? |
Sonoma 14.2.1 (23C71) all mlx related are latest or bleeding edge. I don't think this is a big problem for now. Just thought this may help debug should someone in future run into something strange. |
The generate you want to use is from utils. Which you can import this way: from mlx_vlm import load, generate The
|
Could you provide more context and reproducible example? |
In a jupyterbook cell, run this: from mlx_vlm import load, generate and then use generate to run inference and you should get the error. |
I see, I fixed it, here #24 :) |
Thanks for letting me know! |
I ran into this experimenting in a rather disorganized manner in jupyter notebook.
from mlx_vlm import load, generate
from mlx_vlm.generate import get_model_and_processors
//do some coding, run inference
// and then later
from mlx_vlm import load, generate # do this again by mistake "redundantly"
then get error:
output = generate(model, processor, "http://images.cocodataset.org/val2017/000000039769.jpg", prompt, verbose=False)
TypeError: 'module' object is not callable
this is python 3.10.9 and bet it got something to do with how modules get loaded. generate as a artifact exists as both a method and a module so in this rather contrived way, it caused problem.
this is just a doc of this behaviour in case if this helps others.
The text was updated successfully, but these errors were encountered: