Skip to content
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

Merged
merged 3 commits into from
May 31, 2024

Conversation

gabewillen
Copy link
Contributor

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 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.
@Blaizzy
Copy link
Owner

Blaizzy commented May 31, 2024

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
@gabewillen
Copy link
Contributor Author

Hey @gabewillen

Thanks for the great addition!

Before I merge, could you run pre-commit to clear the tests?

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.

Copy link
Owner

@Blaizzy Blaizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Blaizzy
Copy link
Owner

Blaizzy commented May 31, 2024

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.

Any other changes you want to make before I merge ?

@Blaizzy Blaizzy merged commit 6b46a27 into Blaizzy:main May 31, 2024
1 check passed
@Blaizzy
Copy link
Owner

Blaizzy commented May 31, 2024

Merged 👌🏽

Thank you for the contribution @gabewillen!

@gabewillen
Copy link
Contributor Author

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.

Any other changes you want to make before I merge ?

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!

@Blaizzy
Copy link
Owner

Blaizzy commented May 31, 2024

It will be available on the next release.

@Blaizzy
Copy link
Owner

Blaizzy commented May 31, 2024

@gabewillen what’s your Twitter handle ?

@gabewillen
Copy link
Contributor Author

@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

@gabewillen
Copy link
Contributor Author

gabewillen commented May 31, 2024

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.

@gabewillen
Copy link
Contributor Author

gabewillen commented May 31, 2024

It injects the documentation without modifying any of the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants