Skip to content

Commit

Permalink
fix: eos/bos_token set correctly for Jinja2ChatFormatter and automati…
Browse files Browse the repository at this point in the history
…c chat formatter (abetlen#1230)

The token strings were not correctly retrieved (empty).
  • Loading branch information
CISC authored Feb 28, 2024
1 parent fea33c9 commit c36ab15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llama_cpp/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ def __init__(
except:
bos_token_id = self.token_bos()

eos_token = self.detokenize([eos_token_id]).decode("utf-8")
bos_token = self.detokenize([bos_token_id]).decode("utf-8")
eos_token = self._model.token_get_text(eos_token_id)
bos_token = self._model.token_get_text(bos_token_id)

if self.verbose:
print(f"Using chat template: {template}", file=sys.stderr)
Expand Down

0 comments on commit c36ab15

Please sign in to comment.