mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-24 07:55:07 +01:00
Remove debug line
This commit is contained in:
parent
f65ff9815d
commit
6212d7c2e8
1 changed files with 0 additions and 1 deletions
|
@ -106,7 +106,6 @@ def truncate_message(messages, max_prompt_size, model_name):
|
|||
"""Truncate messages to fit within max prompt size supported by model"""
|
||||
encoder = tiktoken.encoding_for_model(model_name)
|
||||
tokens = sum([len(encoder.encode(message.content)) for message in messages])
|
||||
logger.info(f"num tokens: {tokens}")
|
||||
while tokens > max_prompt_size and len(messages) > 1:
|
||||
messages.pop()
|
||||
tokens = sum([len(encoder.encode(message.content)) for message in messages])
|
||||
|
|
Loading…
Reference in a new issue