mirror of
https://github.com/ivanfioravanti/chatbot-ollama.git
synced 2023-12-01 22:17:38 +03:00
Code cleanup
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user