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

Fix bugs 0801 #1566

Merged
merged 8 commits into from
Aug 1, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
fix template
  • Loading branch information
Jintao-Huang committed Aug 1, 2024
commit 965e92f8a00ec25b70f4132bbe81c21d135a7ecc
6 changes: 3 additions & 3 deletions swift/llm/utils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ def _preprocess_media(self, example):
images = images + images_path
example['images'] = images

# Add default tags to examples to note where to put the medias into the sequence
self.add_default_tags(example)

# Load image into PIL format
from .vision_utils import load_image, rescale_image, _read_batch
images = example.get('images') or []
Expand All @@ -372,9 +375,6 @@ def _preprocess_media(self, example):
images = [rescale_image(img, self.rescale_image) for img in images]
example['images'] = images

# Add default tags to examples to note where to put the medias into the sequence
self.add_default_tags(example)

# Check the example that whether matching the very template's rules
self.check_example(example)

Expand Down
Loading