Skip to content

Commit

Permalink
chore: update gpt token counting
Browse files Browse the repository at this point in the history
seems to have been updated slightly?
  • Loading branch information
zhudotexe committed Oct 24, 2023
1 parent c9ff0a2 commit 6cf7600
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kani/engines/openai/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _load_tokenizer(self):
self.tokenizer = tiktoken.get_encoding("cl100k_base")

def message_len(self, message: ChatMessage) -> int:
mlen = 5 # ChatML = 4, role = 1
mlen = 7
if message.text:
mlen += len(self.tokenizer.encode(message.text))
if message.name:
Expand Down

0 comments on commit 6cf7600

Please sign in to comment.