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

Add Python image upload docs #48

Merged
merged 3 commits into from
Mar 20, 2025
Merged

Add Python image upload docs #48

merged 3 commits into from
Mar 20, 2025

Conversation

ncoghlan
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the CLA signed Indicates that all contributors have signed label Mar 13, 2025
@ncoghlan
Copy link
Collaborator Author

Keeping as draft until version 1.1.0 of the Python SDK has been published to PyPI

@ncoghlan ncoghlan marked this pull request as ready for review March 14, 2025 15:16
Comment on lines +64 to +67
If you only have the raw data of the image, you can supply the raw data directly as a bytes
object without having to write it to disk first. Due to this feature, binary filesystem
paths are *not* supported (as they will be handled as malformed image data rather than as
filesystem paths).
Copy link
Contributor

Choose a reason for hiding this comment

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

This confuses a bit as a Python noob. Maybe provide an example with raw binary input and an example and then an example with IO objects? Though maybe it is unnecessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this bit could definitely be improved to something more like the JS base64 example, but I'd like to hold off on improving it until lmstudio-ai/lmstudio-python#46 has been implemented

That way we can do a more useful example like using pillow to load an image in a format LM Studio doesn't support, and send it to the server in a supported format.

@ncoghlan ncoghlan merged commit 9b080bf into main Mar 20, 2025
1 check passed
@ncoghlan ncoghlan deleted the add-python-image-upload-docs branch March 20, 2025 04:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA signed Indicates that all contributors have signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants