We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please tell me the correct way to send an image to the vision model.
this is my function:
def generate_image_description(image_path): prompt = f"Describe the content of this image: {image_path}." response = client.chat(model='llava-phi3:3.8b', messages=[ { 'role': 'user', 'content': prompt, }, ]) return response['message']['content']
The text was updated successfully, but these errors were encountered:
Please refer to the definition of a "chat message" in the python code Message Type Dict.
The image can be passed in using the "images" key in your message dictionary. The "images" key is a sequence of "bytes" or "path-like str".
Here is an example:
import ollama response = ollama.chat( model="moondream", messages=[ {"role": "user", "content": "Describe the image", "images": ["./cat.jpeg"]} ], ) print(response["message"]['role']) print(response["message"]['content'])
Sorry, something went wrong.
No branches or pull requests
Please tell me the correct way to send an image to the vision model.
this is my function:
def generate_image_description(image_path):
prompt = f"Describe the content of this image: {image_path}."
response = client.chat(model='llava-phi3:3.8b', messages=[
{
'role': 'user',
'content': prompt,
},
])
return response['message']['content']
The text was updated successfully, but these errors were encountered: