fix: eos/bos_token set correctly for Jinja2ChatFormatter and automatic chat formatter (#1230)

The token strings were not correctly retrieved (empty).
This commit is contained in:
Sigbjørn Skjæret 2024-02-28 07:30:31 +01:00 committed by GitHub
parent fea33c9b94
commit c36ab15e68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -408,8 +408,8 @@ class Llama:
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)