Merge pull request #7 from Codium-ai/algo/fix_speacial_tokens

Fix encoding error on special_tokens
This commit is contained in:
Ori Kotek
2023-07-06 14:14:52 +03:00
committed by GitHub

View File

@ -21,4 +21,4 @@ class TokenHandler:
return system_prompt_tokens + user_prompt_tokens
def count_tokens(self, patch: str) -> int:
return len(self.encoder.encode(patch))
return len(self.encoder.encode(patch, disallowed_special=()))