Sergidev commited on
Commit
4054140
1 Parent(s): bcef7b8

Update Context Window Logic

Files changed (1) hide show
  1. modules/pmbl.py +3 -3
modules/pmbl.py CHANGED
@@ -122,10 +122,10 @@ class PMBL:
122
  self.save_chat_history(prompt, response_text)
123
 
124
  def calculate_context(self, system_prompt, formatted_history):
125
- system_prompt_tokens = len(system_prompt) // 12
126
- history_tokens = len(formatted_history) // 12
127
  max_response_tokens = 1500
128
- context_ceiling = 13000
129
 
130
  available_tokens = context_ceiling - system_prompt_tokens - max_response_tokens
131
  if history_tokens <= available_tokens:
 
122
  self.save_chat_history(prompt, response_text)
123
 
124
  def calculate_context(self, system_prompt, formatted_history):
125
+ system_prompt_tokens = len(system_prompt) // 4
126
+ history_tokens = len(formatted_history) // 4
127
  max_response_tokens = 1500
128
+ context_ceiling = 32690
129
 
130
  available_tokens = context_ceiling - system_prompt_tokens - max_response_tokens
131
  if history_tokens <= available_tokens: