Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def make_prompt(messages):
prompt = make_prompt(messages)

# Handle truncation
max_length = get_max_prompt_length(state)
max_length = state['truncation_length']
while len(messages) > 0 and get_encoded_length(prompt) > max_length:
# Try to save the system message
if len(messages) > 1 and messages[0]['role'] == 'system':
Expand Down