-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update load_image function to handle BytesIO input #34
Conversation
The load_image function in mlx_vlm/utils.py is now updated to accept input as BytesIO representing base64 encoded images. This enhances the loading process by accommodating another type of input. Appropriate error handling has been added for potential IO errors.
The import statement has been simplified within the load_image function declaration. The use of typing. prefix has been removed for better readability and cleanliness of the code.
Hey @gabewillen Thanks for the great addition! Before I merge, could you run pre-commit to clear the tests? |
An import line has been rearranged in the utils.py file. The BytesIO import, which is a Python built-in, has been moved up to the section where the rest of the built-in modules are
Absolutely I got ahead of myself on the PR. Apologies I was in the process of following your CONTRIBUTION.md before you commented. It should be good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Any other changes you want to make before I merge ? |
Merged 👌🏽 Thank you for the contribution @gabewillen! |
Not right now but I plan to use this library for a fun project with my kids. Any additions I make I'll be glad to contribute. Excellent work on the library! |
It will be available on the next release. |
@gabewillen what’s your Twitter handle ? |
I don't have a personal one but I do have one for a project I'm working on https://x.com/StateforwardOrg |
I also have a tool I'm getting ready to release that builds dependency graphs of libraries and autogenerates mkdoc compatible documentation using OpenAI. if you'd be interested I can run it on your project. It works really well. |
It injects the documentation without modifying any of the code |
The load_image function in mlx_vlm/utils.py is now updated to accept input as BytesIO representing base64 encoded images. This enhances the loading process by accommodating another type of input. Appropriate error handling has been added for potential IO errors.