Skip to content

Commit

Permalink
Merge branch 'ChatGPTNextWeb:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk-Gosuto authored Mar 30, 2024
2 parents 57cfeb5 + e38b527 commit c74c0ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ export const useChatStore = createPersistStore(
messages: topicMessages,
config: {
model: getSummarizeModel(session.mask.modelConfig.model),
stream: false,
},
onFinish(message) {
get().updateCurrentSession(
Expand Down Expand Up @@ -698,6 +699,10 @@ export const useChatStore = createPersistStore(
historyMsgLength > modelConfig.compressMessageLengthThreshold &&
modelConfig.sendMemory
) {
/** Destruct max_tokens while summarizing
* this param is just shit
**/
const { max_tokens, ...modelcfg } = modelConfig;
api.llm.chat({
messages: toBeSummarizedMsgs.concat(
createMessage({
Expand All @@ -707,7 +712,7 @@ export const useChatStore = createPersistStore(
}),
),
config: {
...modelConfig,
...modelcfg,
stream: true,
model: getSummarizeModel(session.mask.modelConfig.model),
},
Expand Down

0 comments on commit c74c0ac

Please sign in to comment.