Skip to content

Commit

Permalink
fix: remove the condition that uses max_token to reduce the context
Browse files Browse the repository at this point in the history
  • Loading branch information
QAbot-zh committed Aug 14, 2024
1 parent cf1c8e8 commit 3939ff4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ export const useChatStore = createPersistStore(
: shortTermMemoryStartIndex;
// and if user has cleared history messages, we should exclude the memory too.
const contextStartIndex = Math.max(clearContextIndex, memoryStartIndex);
const maxTokenThreshold = modelConfig.max_tokens;
// const maxTokenThreshold = modelConfig.max_tokens;

// get recent messages as much as possible
const reversedRecentMessages = [];
for (
let i = totalMessageCount - 1, tokenCount = 0;
i >= contextStartIndex && tokenCount < maxTokenThreshold;
i >= contextStartIndex ;//&& tokenCount < maxTokenThreshold;
i -= 1
) {
const msg = messages[i];
Expand Down

0 comments on commit 3939ff4

Please sign in to comment.