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 support for prepending images to raw prompts and examples #392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rylativity
Copy link

This PR is related to a PR opened against ollama server to address unexpected behavior when passing both images and raw=True to a generate() call. The issue is described here - #319, and the open PR against ollama server is here - ollama/ollama#8209.

These changes implement the necessary updates to the python client and generate() methods to allow passing an optional bool prepend_images_to_raw_prompt keyword argument to the generate() call. As optional, the change is intended to preserve (and not break) existing users. See associated PR against ollama server linked above for details about how this kwarg will work.

This PR also includes a new example titled multimodal-raw-generate.py which shows both how to use the proposed prepend_images_to_raw_prompt kwarg as well as how to manually place image tags within a raw prompt without the need for prepend_images_to_raw_prompt.

…ages to raw prompt; also includes examples for how to pass images alongside raw prompts
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.

1 participant