File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import { goto } from " $app/navigation" ;
3
+ import { base } from " $app/paths" ;
4
+ import { page } from " $app/state" ;
5
+ import IconDazzled from " ./icons/IconDazzled.svelte" ;
6
+ import Modal from " ./Modal.svelte" ;
7
+
8
+ let { onClose }: { onClose: () => void } = $props ();
9
+ </script >
10
+
11
+ <Modal on:close ={onClose }>
12
+ <div
13
+ class =" from-primary-500/40 via-primary-500/10 to-primary-500/0 flex w-full flex-col items-center gap-3 bg-gradient-to-b px-5 pb-4 pt-9 text-center sm:px-6"
14
+ >
15
+ <div class =" flex flex-wrap items-center gap-2" >
16
+ <IconDazzled classNames =" text-3xl mx-auto" />
17
+ <h2 class =" flex flex-wrap items-center text-lg font-semibold text-gray-800" >
18
+ This model is currently overloaded.
19
+ </h2 >
20
+ </div >
21
+
22
+ <p class =" text-sm text-gray-500" >
23
+ Please try again later or consider using a different model. We currently have {page .data
24
+ .models .length } models available.
25
+ </p >
26
+
27
+ <div class =" flex w-full flex-col items-center gap-4 pt-4" >
28
+ <button
29
+ onclick ={() => (onClose (), goto (` ${base }/models ` ))}
30
+ class =" flex w-full flex-wrap items-center justify-center whitespace-nowrap rounded-full border-2 border-black bg-black px-5 py-2 text-lg font-semibold text-gray-100 transition-colors hover:bg-gray-900"
31
+ >
32
+ See all available models
33
+ </button >
34
+ <button
35
+ onclick ={onClose }
36
+ class =" flex w-fit flex-wrap items-center justify-center whitespace-nowrap px-2 py-1 text-gray-600 transition-colors hover:text-gray-900"
37
+ >
38
+ Close
39
+ </button >
40
+ </div >
41
+ </div >
42
+ </Modal >
Original file line number Diff line number Diff line change 23
23
import ExpandNavigation from " $lib/components/ExpandNavigation.svelte" ;
24
24
import { loginModalOpen } from " $lib/stores/loginModal" ;
25
25
import LoginModal from " $lib/components/LoginModal.svelte" ;
26
+ import OverloadedModal from " $lib/components/OverloadedModal.svelte" ;
27
+ import { isHuggingChat } from " $lib/utils/isHuggingChat" ;
26
28
27
29
let { data = $bindable (), children } = $props ();
28
30
34
36
let isNavOpen = $state (false );
35
37
let isNavCollapsed = $state (false );
36
38
39
+ let overloadedModalOpen = $state (false );
40
+
37
41
let errorToastTimeout: ReturnType <typeof setTimeout >;
38
42
let currentError: string | undefined = $state ();
39
43
47
51
48
52
currentError = $error ;
49
53
54
+ if (currentError === " Model is overloaded" ) {
55
+ overloadedModalOpen = true ;
56
+ }
50
57
errorToastTimeout = setTimeout (() => {
51
58
$error = undefined ;
52
59
currentError = undefined ;
235
242
/>
236
243
{/if }
237
244
245
+ {#if overloadedModalOpen && isHuggingChat }
246
+ <OverloadedModal onClose ={() => (overloadedModalOpen = false )} />
247
+ {/if }
248
+
238
249
<div
239
250
class ="fixed grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd {! isNavCollapsed
240
251
? ' md:grid-cols-[290px,1fr]'
You can’t perform that action at this time.
0 commit comments