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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed Indicates that all contributors have signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants