Skip to content

Commit 53672f3

Browse files
AliBaklyAli Bakly
authored andcommitted
Removed white space, format tests passed
Change-Id: Ia34c4f5b0c55ea62149849612a3b3c18cc291d68
1 parent e3656fe commit 53672f3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

trl/trainer/grpo_trainer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,11 @@ def data_collator(features): # No data collation is needed in GRPO
445445
num_processes = self.accelerator.num_processes
446446
global_batch_size = args.per_device_train_batch_size * num_processes
447447
possible_values = [n_gen for n_gen in range(2, global_batch_size + 1) if (global_batch_size) % n_gen == 0]
448-
449448
if self.num_generations < 2:
450449
raise ValueError(
451450
f"GRPO requires at least 2 generations per prompt to calculate the advantages. "
452451
f"You provided {self.num_generations}, which is less than the minimum required."
453452
)
454-
455453
if self.num_generations not in possible_values:
456454
raise ValueError(
457455
f"The global train batch size ({num_processes} x {args.per_device_train_batch_size}) must be evenly "

0 commit comments

Comments
 (0)