Skip to content

Commit

Permalink
Fix green generation labels
Browse files Browse the repository at this point in the history
  • Loading branch information
slundberg committed Dec 22, 2023
1 parent 8260d85 commit 6b0cabd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion guidance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.8"
__version__ = "0.1.9"

import functools
import os
Expand Down
2 changes: 1 addition & 1 deletion guidance/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ def __call__(self, grammar, max_tokens=1000000, n=1, top_p=1, temperature=0.0, e
token_count = 0
last_token_count = 0
was_forced = False
is_generated = False
captured_data = {}
captured_log_prob_data = {}
while True: # each iteration generates one more token (and some of the associated bytes)
Expand All @@ -670,6 +669,7 @@ def __call__(self, grammar, max_tokens=1000000, n=1, top_p=1, temperature=0.0, e
parser.mark_new_token()

# walk down the trie as far as possible before computing the logits
is_generated = False
retry_token_gen = False
trie = self._token_trie
trie.match_version += 1 # this invalidates all the match caches from the previous token
Expand Down

0 comments on commit 6b0cabd

Please sign in to comment.