Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion caikit_nlp/modules/text_generation/peft_prompt_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ def train(
num_epochs,
cls.RANDOM_SEED,
learning_rate,
max_steps=infer_max_steps(num_epochs, batch_size, training_dataset),
max_steps=infer_max_steps(
num_epochs, batch_size, accumulate_steps, training_dataset
),
silence_progress_bars=silence_progress_bars,
accumulate_steps=accumulate_steps,
# NOTE: following can override above arguments in order
Expand Down
2 changes: 2 additions & 0 deletions caikit_nlp/toolkit/text_generation/training_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ def launch_training(
def infer_max_steps(
num_epochs: int,
batch_size: int,
ga_steps: int,
training_dataset: Union[Dataset, TransformersIterableDataset],
):
batch_size = batch_size * ga_steps
# Calculate the number of samples that we have
if isinstance(training_dataset, Dataset):
data_len = len(training_dataset)
Expand Down