Skip to content

Commit f647ea9

Browse files
authored
Fix model not changing in inference snippet (#673)
1 parent a3a9c9d commit f647ea9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

kit/src/lib/InferenceSnippet/InferenceSnippet.svelte

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,12 @@
5252
let selectedProvider = providers[0];
5353
let streaming = false;
5454
55-
const model = {
56-
id: providersMapping[selectedProvider]!.modelId,
57-
pipeline_tag: pipeline,
58-
tags: conversational ? ["conversational"] : [],
59-
};
60-
6155
const availableSnippets = snippets.getInferenceSnippets(
62-
model as ModelDataMinimal,
56+
{
57+
id: providersMapping[selectedProvider]!.modelId,
58+
pipeline_tag: pipeline,
59+
tags: conversational ? ["conversational"] : [],
60+
} as ModelDataMinimal,
6361
selectedProvider,
6462
{
6563
hfModelId: providersMapping[selectedProvider]!.modelId,
@@ -82,7 +80,11 @@
8280
8381
$: code = snippets
8482
.getInferenceSnippets(
85-
model as ModelDataMinimal,
83+
{
84+
id: providersMapping[selectedProvider]!.modelId,
85+
pipeline_tag: pipeline,
86+
tags: conversational ? ["conversational"] : [],
87+
} as ModelDataMinimal,
8688
selectedProvider,
8789
{
8890
hfModelId: providersMapping[selectedProvider]!.modelId,
@@ -287,7 +289,7 @@
287289
</slot>
288290
<slot slot="menu">
289291
<div class="flex flex-col gap-y-2 p-2">
290-
{#if model.tags.includes("conversational")}
292+
{#if conversational}
291293
<button
292294
class="text-md do-not-close-dropdown group relative flex w-full cursor-default items-center gap-x-2 self-start border-b pb-2 leading-tight"
293295
on:click={() => (streaming = !streaming)}
@@ -340,7 +342,7 @@
340342
</slot>
341343
<slot slot="menu">
342344
<div class="flex flex-col gap-y-2 p-2">
343-
{#if model.tags.includes("conversational")}
345+
{#if conversational}
344346
<button
345347
class="text-md do-not-close-dropdown group relative flex w-full cursor-default items-center gap-x-2 self-start border-b pb-2 leading-tight"
346348
on:click={() => (streaming = !streaming)}

0 commit comments

Comments
 (0)