fix: max tokens bug

This commit is contained in:
Jing Hua 2023-03-19 15:35:23 +08:00
parent e0155e3f4f
commit 9f92cf5c70

View file

@ -55,7 +55,7 @@ const useSubmit = () => {
let stream; let stream;
const messages = limitMessageTokens( const messages = limitMessageTokens(
chats[currentChatIndex].messages, chats[currentChatIndex].messages,
4000 chats[currentChatIndex].config.max_tokens
); );
if (messages.length === 0) throw new Error('Message exceed max token!'); if (messages.length === 0) throw new Error('Message exceed max token!');