Spaces:
Paused
Paused
matt HOFFNER
commited on
Commit
·
328fb13
1
Parent(s):
7e65999
fix
Browse files- .gitignore +2 -0
- components/Chat/Chat.tsx +1 -3
- components/Chat/ChatInput.tsx +1 -8
- next-env.d.ts +5 -0
- pages/api/home/home.tsx +1 -5
- utils/app/const.ts +2 -2
- utils/app/settings.ts +2 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules/
|
| 2 |
+
.next/
|
components/Chat/Chat.tsx
CHANGED
|
@@ -382,9 +382,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
|
|
| 382 |
{selectedConversation?.messages.length === 0 ? (
|
| 383 |
<>
|
| 384 |
<div className="mx-auto flex flex-col space-y-5 md:space-y-10 px-3 pt-5 md:pt-12 sm:max-w-[600px]">
|
| 385 |
-
|
| 386 |
-
Chatbot UI
|
| 387 |
-
</div>
|
| 388 |
|
| 389 |
{models.length > 0 && (
|
| 390 |
<div className="flex h-full flex-col space-y-4 rounded-lg border border-neutral-200 p-4 dark:border-neutral-600">
|
|
|
|
| 382 |
{selectedConversation?.messages.length === 0 ? (
|
| 383 |
<>
|
| 384 |
<div className="mx-auto flex flex-col space-y-5 md:space-y-10 px-3 pt-5 md:pt-12 sm:max-w-[600px]">
|
| 385 |
+
|
|
|
|
|
|
|
| 386 |
|
| 387 |
{models.length > 0 && (
|
| 388 |
<div className="flex h-full flex-col space-y-4 rounded-lg border border-neutral-200 p-4 dark:border-neutral-600">
|
components/Chat/ChatInput.tsx
CHANGED
|
@@ -380,14 +380,7 @@ export const ChatInput = ({
|
|
| 380 |
</div>
|
| 381 |
</div>
|
| 382 |
<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">
|
| 383 |
-
|
| 384 |
-
href="https://erichartford.com/meet-samantha"
|
| 385 |
-
target="_blank"
|
| 386 |
-
rel="noreferrer"
|
| 387 |
-
className="underline"
|
| 388 |
-
>
|
| 389 |
-
Chatting with Samantha-GGML-7B
|
| 390 |
-
</a> running on a <a target="_blank" rel="noreferrer" className="underline" href="https://huggingface.co/spaces/matthoffner/ggml-llm-api">CPU upgrade space</a> using <a target="_blank" rel="noreferrer" className="underline" href="https://github.com/mckaywrigley/chatbot-ui">chatbot-ui</a>
|
| 391 |
</div>
|
| 392 |
</div>
|
| 393 |
);
|
|
|
|
| 380 |
</div>
|
| 381 |
</div>
|
| 382 |
<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">
|
| 383 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
</div>
|
| 385 |
</div>
|
| 386 |
);
|
next-env.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="next" />
|
| 2 |
+
/// <reference types="next/image-types/global" />
|
| 3 |
+
|
| 4 |
+
// NOTE: This file should not be edited
|
| 5 |
+
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
pages/api/home/home.tsx
CHANGED
|
@@ -229,7 +229,7 @@ const Home = ({
|
|
| 229 |
|
| 230 |
useEffect(() => {
|
| 231 |
const settings = getSettings();
|
| 232 |
-
if (settings
|
| 233 |
dispatch({
|
| 234 |
field: 'lightMode',
|
| 235 |
value: settings.theme,
|
|
@@ -349,13 +349,9 @@ const Home = ({
|
|
| 349 |
className={`flex h-screen w-screen flex-col text-sm text-white dark:text-white ${lightMode}`}
|
| 350 |
>
|
| 351 |
<div className="flex h-full w-full pt-[48px] sm:pt-0">
|
| 352 |
-
<Chatbar />
|
| 353 |
-
|
| 354 |
<div className="flex flex-1">
|
| 355 |
<Chat stopConversationRef={stopConversationRef} />
|
| 356 |
</div>
|
| 357 |
-
|
| 358 |
-
<Promptbar />
|
| 359 |
</div>
|
| 360 |
</main>
|
| 361 |
</HomeContext.Provider>
|
|
|
|
| 229 |
|
| 230 |
useEffect(() => {
|
| 231 |
const settings = getSettings();
|
| 232 |
+
if (settings?.theme) {
|
| 233 |
dispatch({
|
| 234 |
field: 'lightMode',
|
| 235 |
value: settings.theme,
|
|
|
|
| 349 |
className={`flex h-screen w-screen flex-col text-sm text-white dark:text-white ${lightMode}`}
|
| 350 |
>
|
| 351 |
<div className="flex h-full w-full pt-[48px] sm:pt-0">
|
|
|
|
|
|
|
| 352 |
<div className="flex flex-1">
|
| 353 |
<Chat stopConversationRef={stopConversationRef} />
|
| 354 |
</div>
|
|
|
|
|
|
|
| 355 |
</div>
|
| 356 |
</main>
|
| 357 |
</HomeContext.Provider>
|
utils/app/const.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
export const DEFAULT_SYSTEM_PROMPT =
|
| 2 |
process.env.NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT ||
|
| 3 |
-
"You are
|
| 4 |
|
| 5 |
export const OPENAI_API_HOST =
|
| 6 |
-
process.env.OPENAI_API_HOST || 'https://api.
|
| 7 |
|
| 8 |
export const DEFAULT_TEMPERATURE =
|
| 9 |
parseFloat(process.env.NEXT_PUBLIC_DEFAULT_TEMPERATURE || "1");
|
|
|
|
| 1 |
export const DEFAULT_SYSTEM_PROMPT =
|
| 2 |
process.env.NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT ||
|
| 3 |
+
"You are a large language model. Follow the user's instructions carefully. Respond using markdown.";
|
| 4 |
|
| 5 |
export const OPENAI_API_HOST =
|
| 6 |
+
process.env.OPENAI_API_HOST || 'https://matthoffner-ggml-llm-api.hf.space';
|
| 7 |
|
| 8 |
export const DEFAULT_TEMPERATURE =
|
| 9 |
parseFloat(process.env.NEXT_PUBLIC_DEFAULT_TEMPERATURE || "1");
|
utils/app/settings.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Settings } from '@/types/settings';
|
|
| 3 |
const STORAGE_KEY = 'settings';
|
| 4 |
|
| 5 |
export const getSettings = (): Settings => {
|
|
|
|
| 6 |
let settings: Settings = {
|
| 7 |
theme: 'dark',
|
| 8 |
};
|
|
@@ -16,6 +17,7 @@ export const getSettings = (): Settings => {
|
|
| 16 |
}
|
| 17 |
}
|
| 18 |
return settings;
|
|
|
|
| 19 |
};
|
| 20 |
|
| 21 |
export const saveSettings = (settings: Settings) => {
|
|
|
|
| 3 |
const STORAGE_KEY = 'settings';
|
| 4 |
|
| 5 |
export const getSettings = (): Settings => {
|
| 6 |
+
/*
|
| 7 |
let settings: Settings = {
|
| 8 |
theme: 'dark',
|
| 9 |
};
|
|
|
|
| 17 |
}
|
| 18 |
}
|
| 19 |
return settings;
|
| 20 |
+
*/
|
| 21 |
};
|
| 22 |
|
| 23 |
export const saveSettings = (settings: Settings) => {
|