Skip to content

Commit

Permalink
sliding window input size adjustment, bigger isn't always better
Browse files Browse the repository at this point in the history
  • Loading branch information
FontaineRiant committed Nov 27, 2024
1 parent b279a11 commit 7a60a3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion story/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def new(self, context: str = ''):
def get_max_history(self):
max_tokens = self.gen.model.config.max_position_embeddings
if hasattr(self.gen.model.config, 'sliding_window'):
max_tokens = min(self.gen.model.config.sliding_window * 2, max_tokens)
max_tokens = min(self.gen.model.config.sliding_window * 1.5, max_tokens)
return max_tokens - self.gen_length

def clean_input(self, action=''):
Expand Down

0 comments on commit 7a60a3a

Please sign in to comment.