Skip to content

Commit

Permalink
missed problem with math
Browse files Browse the repository at this point in the history
  • Loading branch information
renxida committed Nov 26, 2024
1 parent a8d59cc commit 1c08e34
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def acquire_pages_for_tokens(
No token at idx < n_cached_token should be written to. TODO: consider enforcing this.
"""
pages_needed = math.ceil(len(tokens) + extra_token_slots / self.tokens_per_page)
token_count = len(tokens)
pages_needed = math.ceil(token_count / self.tokens_per_page)
pages = self.page_pool.acquire_free_pages(pages_needed)

n_cached_tokens = 0
Expand Down

0 comments on commit 1c08e34

Please sign in to comment.