diff --git a/swift/trainers/sequence_parallel/ulysses.py b/swift/trainers/sequence_parallel/ulysses.py index 186ca619e7..1206c87990 100644 --- a/swift/trainers/sequence_parallel/ulysses.py +++ b/swift/trainers/sequence_parallel/ulysses.py @@ -703,10 +703,9 @@ def prepare_inputs(self, inputs): 2. split labels """ position_ids = None - if self.padding_free: - position_ids = inputs.get('text_position_ids') - if position_ids is None: - position_ids = inputs.get('position_ids') + position_ids = inputs.get('text_position_ids') + if position_ids is None: + position_ids = inputs.get('position_ids') if position_ids is not None and position_ids.shape[0] == 1: self.extra_kwargs['text_position_ids'] = position_ids.clone() if 'labels' in inputs: