Spaces:
Sleeping
Sleeping
trim more
Browse files- app.py +1 -1
- chatbot_simulator.py +1 -1
app.py
CHANGED
@@ -3,7 +3,7 @@ from chatbot_simulator import ChatbotSimulation
|
|
3 |
from task_specific_data_population import DataPopulation
|
4 |
import os
|
5 |
|
6 |
-
openai_api_key = os.getenv("OPENAI_API_KEY")
|
7 |
|
8 |
|
9 |
class AppSimulator:
|
|
|
3 |
from task_specific_data_population import DataPopulation
|
4 |
import os
|
5 |
|
6 |
+
openai_api_key = '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'#os.getenv("OPENAI_API_KEY")
|
7 |
|
8 |
|
9 |
class AppSimulator:
|
chatbot_simulator.py
CHANGED
@@ -84,7 +84,7 @@ Rules:
|
|
84 |
|
85 |
def _trim_conversation(self):
|
86 |
"""Trim the conversation to keep it within the token limit."""
|
87 |
-
while self._calculate_token_count(self.conversation) > self.max_tokens - (self.buffer_tokens+
|
88 |
self.conversation.pop(0) #
|
89 |
|
90 |
def one_conversation_round(self, user_input):
|
|
|
84 |
|
85 |
def _trim_conversation(self):
|
86 |
"""Trim the conversation to keep it within the token limit."""
|
87 |
+
while self._calculate_token_count(self.conversation) > self.max_tokens - (self.buffer_tokens+1000):
|
88 |
self.conversation.pop(0) #
|
89 |
|
90 |
def one_conversation_round(self, user_input):
|