Skip to content

Commit

Permalink
Handling block_size value for models with no sequence length limit. (#…
Browse files Browse the repository at this point in the history
…1487)

* handle block size -1

* change where to fetch

---------

Co-authored-by: Adam Louly <[email protected]@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
  • Loading branch information
AdamLouly and Adam Louly authored Oct 27, 2023
1 parent 313e1bd commit e164827
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/onnxruntime/training/language-modeling/run_clm.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ def tokenize_function(examples):

if hasattr(config, "max_position_embeddings"):
max_pos_embeddings = config.max_position_embeddings
if max_pos_embeddings < 0:
max_pos_embeddings = 1024
else:
# Define a default value if the attribute is missing in the config.
max_pos_embeddings = 1024
Expand Down

0 comments on commit e164827

Please sign in to comment.