Skip to content

Commit

Permalink
Setting hardcoded max seq length
Browse files Browse the repository at this point in the history
  • Loading branch information
kannangce committed Oct 29, 2023
1 parent be5c47b commit 60c6a2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion finetune/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def train(
) -> None:
tokenizer = Tokenizer(checkpoint_dir)
longest_seq_length, longest_seq_ix = get_longest_seq_length(train_data)
model.max_seq_length = longest_seq_length

# The existing code model.max_seq_length = longest_seq_length
# sets the maximum length based on the training data, which seem to less. Hence setting it to a hardcoded number.
model.max_seq_length = 500
fabric.print(
f"The longest sequence length in the train data is {longest_seq_length}, the model's maximum sequence length is"
f" {model.max_seq_length} and context length is {model.config.block_size}"
Expand Down

0 comments on commit 60c6a2f

Please sign in to comment.