Remove debug line

This commit is contained in:
Saba 2023-06-05 19:00:25 -07:00
parent f65ff9815d
commit 6212d7c2e8

View file

@ -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])