Spaces:
Paused
Paused
matthoffner
commited on
Commit
·
e2cfe89
1
Parent(s):
81043ab
Update pages/api/home/home.tsx
Browse files- pages/api/home/home.tsx +2 -26
pages/api/home/home.tsx
CHANGED
@@ -76,28 +76,6 @@ const Home = ({
|
|
76 |
|
77 |
const stopConversationRef = useRef<boolean>(false);
|
78 |
|
79 |
-
const { data, error, refetch } = useQuery(
|
80 |
-
['GetModels', apiKey, serverSideApiKeyIsSet],
|
81 |
-
({ signal }) => {
|
82 |
-
|
83 |
-
return getModels(
|
84 |
-
{
|
85 |
-
key: 'apiKey',
|
86 |
-
},
|
87 |
-
signal,
|
88 |
-
);
|
89 |
-
},
|
90 |
-
{ enabled: true, refetchOnMount: false },
|
91 |
-
);
|
92 |
-
|
93 |
-
useEffect(() => {
|
94 |
-
if (data) dispatch({ field: 'models', value: data });
|
95 |
-
}, [data, dispatch]);
|
96 |
-
|
97 |
-
useEffect(() => {
|
98 |
-
dispatch({ field: 'modelError', value: getModelsError(error) });
|
99 |
-
}, [dispatch, error, getModelsError]);
|
100 |
-
|
101 |
// FETCH MODELS ----------------------------------------------
|
102 |
|
103 |
const handleSelectConversation = (conversation: Conversation) => {
|
@@ -359,7 +337,7 @@ const Home = ({
|
|
359 |
}}
|
360 |
>
|
361 |
<Head>
|
362 |
-
<title>Chatbot UI</title>
|
363 |
<meta name="description" content="ChatGPT but better." />
|
364 |
<meta
|
365 |
name="viewport"
|
@@ -367,8 +345,7 @@ const Home = ({
|
|
367 |
/>
|
368 |
<link rel="icon" href="/favicon.ico" />
|
369 |
</Head>
|
370 |
-
|
371 |
-
<main
|
372 |
className={`flex h-screen w-screen flex-col text-sm text-white dark:text-white ${lightMode}`}
|
373 |
>
|
374 |
<div className="fixed top-0 w-full sm:hidden">
|
@@ -388,7 +365,6 @@ const Home = ({
|
|
388 |
<Promptbar />
|
389 |
</div>
|
390 |
</main>
|
391 |
-
)}
|
392 |
</HomeContext.Provider>
|
393 |
);
|
394 |
};
|
|
|
76 |
|
77 |
const stopConversationRef = useRef<boolean>(false);
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
// FETCH MODELS ----------------------------------------------
|
80 |
|
81 |
const handleSelectConversation = (conversation: Conversation) => {
|
|
|
337 |
}}
|
338 |
>
|
339 |
<Head>
|
340 |
+
<title>Minimal Chatbot UI</title>
|
341 |
<meta name="description" content="ChatGPT but better." />
|
342 |
<meta
|
343 |
name="viewport"
|
|
|
345 |
/>
|
346 |
<link rel="icon" href="/favicon.ico" />
|
347 |
</Head>
|
348 |
+
<main
|
|
|
349 |
className={`flex h-screen w-screen flex-col text-sm text-white dark:text-white ${lightMode}`}
|
350 |
>
|
351 |
<div className="fixed top-0 w-full sm:hidden">
|
|
|
365 |
<Promptbar />
|
366 |
</div>
|
367 |
</main>
|
|
|
368 |
</HomeContext.Provider>
|
369 |
);
|
370 |
};
|