Skip to content

Commit

Permalink
Generation uses config.max_seq_len instead of default 2048 (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
flotos authored Aug 9, 2023
1 parent e9da620 commit 82369c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def generate_simple(self, prompt, max_new_tokens = 128):

self.end_beam_search()

ids, mask = self.tokenizer.encode(prompt, return_mask = True)
ids, mask = self.tokenizer.encode(prompt, return_mask = True, max_seq_len = self.model.config.max_seq_len)
self.gen_begin(ids, mask = mask)

max_new_tokens = min(max_new_tokens, self.model.config.max_seq_len - ids.shape[1])
Expand Down

0 comments on commit 82369c5

Please sign in to comment.