-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow for arbitrary examples containing DSPy.Images #1801
base: main
Are you sure you want to change the base?
Conversation
examples/vlm/mmmu.ipynb
Outdated
"class ColorSignature(dspy.Signature):\n", | ||
" \"\"\"Output the color of the designated image.\"\"\"\n", | ||
" image_1: dspy.Image = dspy.InputField(desc=\"An image\")\n", | ||
" image_2: dspy.Image = dspy.InputField(desc=\"An image\")\n", | ||
" images: List[dspy.Image] = dspy.InputField(desc=\"An image\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" images: List[dspy.Image] = dspy.InputField(desc=\"An image\")\n", | |
" images: List[dspy.Image] = dspy.InputField(desc=\"A list of images\")\n", |
Thanks for the PR @isaacbmiller. I tried this branch with this signature and sharing relevant logs here with you: class CreateTitleAndDescription(dspy.Signature):
"""Taking in a list of images and a category tree to output title, description and attributes."""
images: List[dspy.Image] = dspy.InputField(desc="list of images about the item")
categories: str = dspy.InputField(desc="category tree of the item")
title: str = dspy.OutputField(desc=title_desc)
description: str = dspy.OutputField(desc=description_desc) {
'role': 'user',
'content': '[[ ## images ## ]]\n["https://static-sd.mercdn.net/photos/m34859626959_1.jpg", "https://static-sd.mercdn.net/photos/m34859626959_2.jpg", "https://static-sd.mercdn.net/photos/m34859626959_3.jpg"]\n\n[[ ## categories ## ]]\nゲーム・おもちゃ・グッズ > トレーディングカード\n\nRespond with the corresponding output fields, starting with the field `[[ ## title ## ]]`, then `[[ ## description ## ]]`, and then ending with the marker for `[[ ## completed ## ]]`.'
} |
6a8376a
to
acf10ee
Compare
acf10ee
to
66d991d
Compare
Tagging @chenmoneygithub to make sure that none of the serialization behavior changes here interfere with your plans |
NOTE: JSONAdapter is still not supported and will be handled in a separate PR |
Inspired by #1763 and to close #1767.
Goal is to support images inside arbitrary pydantic objects and to eventually make it easy to add support for other modalities.