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

Adjust the order of InternVL dataset log printing #889

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions xtuner/dataset/internvl_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,11 @@ def get_inputid_labels(self, conversations, image_token_str) -> dict:
labels += copy.deepcopy(output_encode)

if len(input_ids) > self.max_length:
input_ids = input_ids[:self.max_length]
labels = labels[:self.max_length]
print_log(
f'Warning: input_ids length({len(input_ids)}) '
f'is longer than max_length, cut to {self.max_length}',
logger='current')
input_ids = input_ids[:self.max_length]
labels = labels[:self.max_length]

return {'input_ids': input_ids, 'labels': labels}
Loading