File size: 984 Bytes
411fba2
5213b80
86574c0
3138e12
 
781a165
86574c0
 
411fba2
 
 
 
 
 
 
 
 
781a165
411fba2
86574c0
411fba2
 
3138e12
411fba2
 
c077f8a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script lang="ts">
	import { type ModelEntry } from '@huggingface/hub';
	import { createEventDispatcher } from 'svelte';

	export let compatibleModels: ModelEntry[] = [];
	export let disabled = false;

	const dispatch = createEventDispatcher<{ modelIdxChange: number }>();
</script>

<div>
	<label
		for="countries"
		class="mb-2 flex items-baseline text-sm font-medium text-gray-900 dark:text-white"
		>Models<span class="ml-4 font-normal text-gray-400">{compatibleModels.length}</span>
	</label>
	<select
		{disabled}
		class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
		on:change={(e) => dispatch('modelIdxChange', e.currentTarget.selectedIndex)}
	>
		{#each compatibleModels as model}
			<option value={model.id}>{model.id}</option>
		{/each}
	</select>
</div>