featued models and other models
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
|
4 |
import { createEventDispatcher } from "svelte";
|
5 |
|
|
|
6 |
import IconSearch from "../Icons/IconSearch.svelte";
|
7 |
import IconStar from "../Icons/IconStar.svelte";
|
8 |
|
@@ -28,6 +29,9 @@
|
|
28 |
dispatch("close");
|
29 |
}
|
30 |
}
|
|
|
|
|
|
|
31 |
</script>
|
32 |
|
33 |
<svelte:window on:keydown={handleKeydown} />
|
@@ -52,29 +56,30 @@
|
|
52 |
<div class="p-1">
|
53 |
<div class="px-2 py-1.5 text-xs font-medium text-gray-500">Trending</div>
|
54 |
<div>
|
55 |
-
|
56 |
-
|
57 |
-
<
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
<div class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100">
|
64 |
-
<IconStar classNames="lucide lucide-star mr-2 h-4 w-4 text-yellow-400" />
|
65 |
-
<span class="inline-flex items-center"
|
66 |
-
><span class="text-gray-500">mistralai</span><span class="mx-1 text-black">/</span><span
|
67 |
-
class="text-black">Mixtral-8x7B-Instruct-v0.1</span
|
68 |
-
></span
|
69 |
>
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
</div>
|
72 |
</div>
|
73 |
<div class="mx-1 h-px bg-gray-200"></div>
|
74 |
<div class="p-1">
|
75 |
<div class="px-2 py-1.5 text-xs font-medium text-gray-500">Other Models</div>
|
76 |
<div>
|
77 |
-
{#each
|
78 |
{@const [nameSpace, modelName] = model.id.split("/")}
|
79 |
<button
|
80 |
class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100"
|
|
|
3 |
|
4 |
import { createEventDispatcher } from "svelte";
|
5 |
|
6 |
+
import { FEATUED_MODELS_IDS } from "./inferencePlaygroundUtils";
|
7 |
import IconSearch from "../Icons/IconSearch.svelte";
|
8 |
import IconStar from "../Icons/IconStar.svelte";
|
9 |
|
|
|
29 |
dispatch("close");
|
30 |
}
|
31 |
}
|
32 |
+
|
33 |
+
$: featuredModels = models.filter(m => FEATUED_MODELS_IDS.includes(m.id));
|
34 |
+
$: otherModels = models.filter(m => !FEATUED_MODELS_IDS.includes(m.id));
|
35 |
</script>
|
36 |
|
37 |
<svelte:window on:keydown={handleKeydown} />
|
|
|
56 |
<div class="p-1">
|
57 |
<div class="px-2 py-1.5 text-xs font-medium text-gray-500">Trending</div>
|
58 |
<div>
|
59 |
+
{#each featuredModels as model}
|
60 |
+
{@const [nameSpace, modelName] = model.id.split("/")}
|
61 |
+
<button
|
62 |
+
class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100"
|
63 |
+
on:click={() => {
|
64 |
+
dispatch("modelSelected", model.id);
|
65 |
+
dispatch("close");
|
66 |
+
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
>
|
68 |
+
<IconStar classNames="lucide lucide-star mr-2 h-4 w-4 text-yellow-400" />
|
69 |
+
<span class="inline-flex items-center"
|
70 |
+
><span class="text-gray-500">{nameSpace}</span><span class="mx-1 text-black">/</span><span
|
71 |
+
class="text-black">{modelName}</span
|
72 |
+
></span
|
73 |
+
>
|
74 |
+
</button>
|
75 |
+
{/each}
|
76 |
</div>
|
77 |
</div>
|
78 |
<div class="mx-1 h-px bg-gray-200"></div>
|
79 |
<div class="p-1">
|
80 |
<div class="px-2 py-1.5 text-xs font-medium text-gray-500">Other Models</div>
|
81 |
<div>
|
82 |
+
{#each otherModels as model}
|
83 |
{@const [nameSpace, modelName] = model.id.split("/")}
|
84 |
<button
|
85 |
class="flex cursor-pointer items-center px-2 py-1.5 text-sm hover:bg-gray-100"
|
src/lib/components/InferencePlayground/inferencePlaygroundUtils.ts
CHANGED
@@ -61,3 +61,9 @@ export async function handleNonStreamingResponse(
|
|
61 |
export function isSystemPromptSupported(model: ModelEntryWithTokenizer) {
|
62 |
return model.tokenizerConfig?.chat_template?.includes("system");
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
export function isSystemPromptSupported(model: ModelEntryWithTokenizer) {
|
62 |
return model.tokenizerConfig?.chat_template?.includes("system");
|
63 |
}
|
64 |
+
|
65 |
+
export const FEATUED_MODELS_IDS = [
|
66 |
+
"meta-llama/Meta-Llama-3-70B-Instruct",
|
67 |
+
"google/gemma-1.1-7b-it",
|
68 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
69 |
+
];
|