Skip to content

Commit

Permalink
Fix TypeError: Model._report_failed_match() takes 1 positional argume…
Browse files Browse the repository at this point in the history
…nt but 2 were given #552
  • Loading branch information
slundberg committed Dec 20, 2023
1 parent 8418ea6 commit 8260d85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guidance/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,9 @@ def _clean_duplicate_tokens(self, probs):
probs[j] += probs[i]
probs[i] = 0

def _report_failed_match(self):
def _report_failed_match(self, prompt):
"""Note that this can be overridden by subclasses that have more likely reasons than a bug in the token set (like remote models)."""
return Exception("We can't consume any more tokens, but we are not yet done! Perhaps your model's token set is incomplete?")
return Exception("We can't consume any more tokens, but we are not yet done! Perhaps your model's token set is incomplete? This happened after the prompt:" + str(prompt[-40:]))

def __call__(self, grammar, max_tokens=1000000, n=1, top_p=1, temperature=0.0, ensure_bos_token=True):
assert n == 1, "Still need to add support for n > 1!"
Expand Down

0 comments on commit 8260d85

Please sign in to comment.