Code cleanup

This commit is contained in:
ivanfioravanti
2023-10-02 20:54:22 +02:00
parent d2ed88a702
commit 79942d023f
3 changed files with 1 additions and 15 deletions

View File

@@ -289,14 +289,6 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
};
const throttledScrollDown = throttle(scrollDown, 250);
// useEffect(() => {
// console.log('currentMessage', currentMessage);
// if (currentMessage) {
// handleSend(currentMessage);
// homeDispatch({ field: 'currentMessage', value: undefined });
// }
// }, [currentMessage]);
useEffect(() => {
throttledScrollDown();
selectedConversation &&

View File

@@ -337,7 +337,7 @@ export const ChatInput = ({
</div>
<div className="px-3 pt-2 pb-3 text-center text-[12px] text-black/50 dark:text-white/50 md:px-4 md:pt-3 md:pb-6">
<a
href="https://github.com/mckaywrigley/chatbot-ollama"
href="https://github.com/ivanfioravanti/chatbot-ollama"
target="_blank"
rel="noreferrer"
className="underline"

View File

@@ -3,11 +3,6 @@ import { OllamaError, OllamaStream } from '@/utils/server';
import { ChatBody, Message } from '@/types/chat';
// @ts-expect-error
import wasm from '../../node_modules/@dqbd/tiktoken/lite/tiktoken_bg.wasm?module';
import tiktokenModel from '@dqbd/tiktoken/encoders/cl100k_base.json';
import { Tiktoken, init } from '@dqbd/tiktoken/lite/init';
export const config = {
runtime: 'edge',
@@ -17,7 +12,6 @@ const handler = async (req: Request): Promise<Response> => {
try {
const { model, system, options, prompt } = (await req.json()) as ChatBody;
await init((imports) => WebAssembly.instantiate(wasm, imports));
let promptToSend = system;
if (!promptToSend) {