8000 Update VisionLanguageConversationFeatureGenerator by nikg4 · Pull Request #1531 · oumi-ai/oumi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update VisionLanguageConversationFeatureGenerator #1531

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,30 +231,28 @@ def transform_conversations(

valid_options: FeatureGeneratorOptions = options or FeatureGeneratorOptions()

all_images: list[list[Image.Image]] = []
all_prompts: list[str] = []
if self._processor.chat_template is None:
all_images = []
all_prompts = []
for conversation in conversations:
image, prompt = self._prepare_simple_model(conversation)
all_images.append(image)
all_images.append([image])
all_prompts.append(prompt)

inputs = self._processor(
images=all_images,
images=[image for item in all_images for image in item],
text=all_prompts,
return_tensors=self._return_tensors,
padding=True,
)
else:
all_images = []
all_prompts = []
for conversation in conversations:
images, prompt = self._prepare_instruct_model(conversation)
all_images.append(images)
all_prompts.append(prompt)

inputs = self._processor(
images=all_images,
images=[image for item in all_images for image in item],
text=all_prompts,
return_tensors=self._return_tensors,
padding=True,
Expand Down
0