diff --git a/components/ChatMenu/ChatWindow/ChatFrame.tsx b/components/ChatMenu/ChatWindow/ChatFrame.tsx index 6a2470c..ebbae54 100644 --- a/components/ChatMenu/ChatWindow/ChatFrame.tsx +++ b/components/ChatMenu/ChatWindow/ChatFrame.tsx @@ -1,13 +1,12 @@ import { View, Text, Image, StyleSheet } from 'react-native' import { ReactNode, useEffect, useState } from 'react' -import { ChatEntry, Chats } from '@constants/Chat' +import { Chats } from '@constants/Chat' import { Characters, Style } from '@globals' import TTSMenu from './TTS' import { useShallow } from 'zustand/react/shallow' type ChatFrameProps = { children?: ReactNode - userName: string TTSenabled: boolean id: number charId: number @@ -17,15 +16,15 @@ type ChatFrameProps = { const ChatFrame: React.FC = ({ children, - userName, TTSenabled, id, nowGenerating, isLast, }) => { - const { message } = Chats.useChat( + const { message, buffer } = Chats.useChat( useShallow((state) => ({ message: state?.data?.messages?.[id] ?? Chats.dummyEntry, + buffer: state.buffer, })) ) @@ -51,21 +50,14 @@ const ChatFrame: React.FC = ({ setImageSource(require('@assets/user.png')) } - const getDeltaTime = () => - Math.round( - Math.max( - 0, - ((nowGenerating && isLast ? new Date().getTime() : swipe.gen_finished.getTime()) - - swipe.gen_started.getTime()) / - 1000 - ) + const deltaTime = Math.round( + Math.max( + 0, + ((nowGenerating && isLast ? new Date().getTime() : swipe.gen_finished.getTime()) - + swipe.gen_started.getTime()) / + 1000 ) - - const [deltaTime, setDeltaTime] = useState(getDeltaTime()) - - useEffect(() => { - setDeltaTime(getDeltaTime()) - }, [nowGenerating]) + ) // TODO: Change TTS to take id and simply retrieve that data on TTS as needed return ( diff --git a/components/ChatMenu/ChatWindow/ChatItem.tsx b/components/ChatMenu/ChatWindow/ChatItem.tsx index 21fd025..5401699 100644 --- a/components/ChatMenu/ChatWindow/ChatItem.tsx +++ b/components/ChatMenu/ChatWindow/ChatItem.tsx @@ -29,7 +29,6 @@ const ChatItem: React.FC = ({ }}> Promise deleteEntry: (index: number) => Promise reset: () => void diff --git a/constants/Inference.ts b/constants/Inference.ts index 72d6a96..3fc8b5f 100644 --- a/constants/Inference.ts +++ b/constants/Inference.ts @@ -251,8 +251,6 @@ const constructStopSequence = (instruct: InstructType): Array => { const sequence: Array = [] if (instruct.stop_sequence !== '') instruct.stop_sequence.split(',').forEach((item) => item !== '' && sequence.push(item)) - // maybe people rather this not be removed? - //sequence.push(instruct.input_sequence) return sequence } @@ -509,7 +507,6 @@ const constructOpenRouterPayload = () => { const openRouterModel = getObject(Global.OpenRouterModel) const currentInstruct = Instructs.useInstruct.getState().replacedMacros() const preset = getObject(Global.PresetData) - console.log(getSeed(preset.seed)) return { messages: buildChatCompletionContext(openRouterModel.context_length), model: openRouterModel.id,