|
52 | 52 | let selectedProvider = providers[0]; |
53 | 53 | let streaming = false; |
54 | 54 |
|
55 | | - const model = { |
56 | | - id: providersMapping[selectedProvider]!.modelId, |
57 | | - pipeline_tag: pipeline, |
58 | | - tags: conversational ? ["conversational"] : [], |
59 | | - }; |
60 | | -
|
61 | 55 | 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, |
63 | 61 | selectedProvider, |
64 | 62 | { |
65 | 63 | hfModelId: providersMapping[selectedProvider]!.modelId, |
|
82 | 80 |
|
83 | 81 | $: code = snippets |
84 | 82 | .getInferenceSnippets( |
85 | | - model as ModelDataMinimal, |
| 83 | + { |
| 84 | + id: providersMapping[selectedProvider]!.modelId, |
| 85 | + pipeline_tag: pipeline, |
| 86 | + tags: conversational ? ["conversational"] : [], |
| 87 | + } as ModelDataMinimal, |
86 | 88 | selectedProvider, |
87 | 89 | { |
88 | 90 | hfModelId: providersMapping[selectedProvider]!.modelId, |
|
287 | 289 | </slot> |
288 | 290 | <slot slot="menu"> |
289 | 291 | <div class="flex flex-col gap-y-2 p-2"> |
290 | | - {#if model.tags.includes("conversational")} |
| 292 | + {#if conversational} |
291 | 293 | <button |
292 | 294 | 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" |
293 | 295 | on:click={() => (streaming = !streaming)} |
|
340 | 342 | </slot> |
341 | 343 | <slot slot="menu"> |
342 | 344 | <div class="flex flex-col gap-y-2 p-2"> |
343 | | - {#if model.tags.includes("conversational")} |
| 345 | + {#if conversational} |
344 | 346 | <button |
345 | 347 | 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" |
346 | 348 | on:click={() => (streaming = !streaming)} |
|
0 commit comments