refactor a bit
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte
CHANGED
@@ -17,6 +17,17 @@
|
|
17 |
|
18 |
const dispatch = createEventDispatcher<{ modelSelected: string; close: void }>();
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
function handleKeydown(event: KeyboardEvent) {
|
21 |
const { key } = event;
|
22 |
let scrollLogicalPosition: ScrollLogicalPosition = "end";
|
@@ -69,17 +80,6 @@
|
|
69 |
dispatch("close");
|
70 |
}
|
71 |
}
|
72 |
-
|
73 |
-
$: featuredModels = models.filter(m =>
|
74 |
-
query
|
75 |
-
? FEATUED_MODELS_IDS.includes(m.id) && m.id.toLocaleLowerCase().includes(query.toLocaleLowerCase().trim())
|
76 |
-
: FEATUED_MODELS_IDS.includes(m.id)
|
77 |
-
);
|
78 |
-
$: otherModels = models.filter(m =>
|
79 |
-
query
|
80 |
-
? !FEATUED_MODELS_IDS.includes(m.id) && m.id.toLocaleLowerCase().includes(query.toLocaleLowerCase().trim())
|
81 |
-
: !FEATUED_MODELS_IDS.includes(m.id)
|
82 |
-
);
|
83 |
</script>
|
84 |
|
85 |
<svelte:window on:keydown={handleKeydown} on:mousemove={() => (ignoreCursorHighlight = false)} />
|
|
|
17 |
|
18 |
const dispatch = createEventDispatcher<{ modelSelected: string; close: void }>();
|
19 |
|
20 |
+
const featuredModels = models.filter(m =>
|
21 |
+
query
|
22 |
+
? FEATUED_MODELS_IDS.includes(m.id) && m.id.toLocaleLowerCase().includes(query.toLocaleLowerCase().trim())
|
23 |
+
: FEATUED_MODELS_IDS.includes(m.id)
|
24 |
+
);
|
25 |
+
const otherModels = models.filter(m =>
|
26 |
+
query
|
27 |
+
? !FEATUED_MODELS_IDS.includes(m.id) && m.id.toLocaleLowerCase().includes(query.toLocaleLowerCase().trim())
|
28 |
+
: !FEATUED_MODELS_IDS.includes(m.id)
|
29 |
+
);
|
30 |
+
|
31 |
function handleKeydown(event: KeyboardEvent) {
|
32 |
const { key } = event;
|
33 |
let scrollLogicalPosition: ScrollLogicalPosition = "end";
|
|
|
80 |
dispatch("close");
|
81 |
}
|
82 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
</script>
|
84 |
|
85 |
<svelte:window on:keydown={handleKeydown} on:mousemove={() => (ignoreCursorHighlight = false)} />
|