Spaces:
Runtime error
Runtime error
Dynamic max tokens
Browse files11 unmodified lines121314151516171819202021212223242526272826272829303132333435363735363738394011 unmodified lines
<div class="flex flex-col gap-y-5 {classNames}"> {#each GENERATION_CONFIG_KEYS as key} {@const settings = GENERATION_CONFIG_SETTINGS[key]} {@const { label, min, step } = GENERATION_CONFIG_SETTINGS[key]} {@const max = key === 'max_tokens' ? 1000 : GENERATION_CONFIG_SETTINGS[key].max} <div> <div class="flex items-center justify-between"> <label for="temperature-range" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white" >{settings.label}</label class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">{label}</label > <input type="number" class="w-16 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700" min={settings.min} max={settings.max} step={settings.step} {min} max={key === 'max_tokens' ? 1000 : max} {step} bind:value={config[key]} /> </div> <input id="temperature-range" type="range" min={settings.min} max={settings.max} step={settings.step} {min} max={key === 'max_tokens' ? 1000 : max} {step} bind:value={config[key]} class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700 dark:accent-blue-500" />src/lib/components/InferencePlayground/InferencePlaygroundGenerationConfig.svelte+9-9