Skip to content

Commit

Permalink
Fix max_length issue
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsuid committed Sep 24, 2022
1 parent 7845eb7 commit fcb961e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gpt_neo_125m/tune_gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def format_input(dataset):
coding_problems = format_input(raw_ds)

max_length = max([len(tokenizer.encode(coding_problem)) for coding_problem in coding_problems])
model_max_length = model.config.max_position_embeddings
max_length = max_length if max_length <= model_max_length else model_max_length
print("Max length: {}".format(max_length))


Expand Down

0 comments on commit fcb961e

Please sign in to comment.