Spaces:
Runtime error
Runtime error
Max tokens (#32)
Browse filesFiles changed (3)
364 unmodified lines365366367368369370371372373374364 unmodified lines</select></div><PlaygroundOptionsbind:config={conversations[0].config}bind:streaming={conversations[0].streaming}/><div class="mt-auto"><div class="mb-3 flex items-center justify-between gap-2"><label364 unmodified lines365366367368369370371364 unmodified lines</select></div><PlaygroundOptions bind:conversation={conversations[0]} /><div class="mt-auto"><div class="mb-3 flex items-center justify-between gap-2"><label
3 unmodified lines45678910111252 unmodified lines65666768697071723 unmodified linesimport Message from './InferencePlaygroundMessage.svelte';import PlaygroundOptions from './InferencePlaygroundGenerationConfig.svelte';import IconPlus from '../Icons/IconPlus.svelte';export let loading;export let conversation;export let index;export let viewCode;export let sideBySide = false;52 unmodified lines/></svg><PlaygroundOptionsbind:config={conversation.config}bind:streaming={conversation.streaming}classNames="absolute top-8 right-0 w-56 invisible group-focus:visible hover:visible border border-gray-200/80 bg-white z-10 px-4 py-6 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-800 rounded-xl"/></button>3 unmodified lines4567891011121352 unmodified lines666768697071723 unmodified linesimport Message from './InferencePlaygroundMessage.svelte';import PlaygroundOptions from './InferencePlaygroundGenerationConfig.svelte';import IconPlus from '../Icons/IconPlus.svelte';import type { Conversation } from '$lib/types';export let loading;export let conversation: Conversation;export let index;export let viewCode;export let sideBySide = false;52 unmodified lines/></svg><PlaygroundOptionsbind:conversationclassNames="absolute top-8 right-0 w-56 invisible group-focus:visible hover:visible border border-gray-200/80 bg-white z-10 px-4 py-6 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-800 rounded-xl"/></button>
123456789101112131415161718192021222324252627282930313233343536373839404117 unmodified lines59606162636465662 unmodified lines69707172737475763 unmodified lines80818283848586<script lang="ts">import {GENERATION_CONFIG_KEYS,GENERATION_CONFIG_KEYS_ADVANCED,GENERATION_CONFIG_SETTINGS} from './generationConfigSettings';export let config;export let streaming: boolean;export let classNames = '';</script><div class="flex flex-col gap-y-5 {classNames}">{#each GENERATION_CONFIG_KEYS as key}{@const settings = GENERATION_CONFIG_SETTINGS[key]}<div><div class="flex items-center justify-between"><labelfor="temperature-range"class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">{settings.label}</label><inputtype="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}bind:value={config[key]}/></div><inputid="temperature-range"type="range"min={settings.min}max={settings.max}step={settings.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"/></div>17 unmodified linesmin={settings.min}max={settings.max}step={settings.step}value={config[key] ?? settings.default}on:input={(e) => (config[key] = e.currentTarget.value)}/></div><input2 unmodified linesmin={settings.min}max={settings.max}step={settings.step}value={config[key] ?? settings.default}on:input={(e) => (config[key] = e.currentTarget.value)}class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700 dark:accent-blue-500"/></div>3 unmodified lines<div class="mt-2"><label class="flex cursor-pointer items-center justify-between"><input type="checkbox" bind:checked={streaming} class="peer sr-only" /><span class="text-sm font-medium text-gray-900 dark:text-gray-300">Streaming</span><divclass="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:peer-checked:bg-blue-600"123456789101112131415161718192021222324252627282930313233343536373839404142434417 unmodified lines62636465666768692 unmodified lines72737475767778793 unmodified lines83848586878889<script lang="ts">import type { Conversation } from '$lib/types';import {GENERATION_CONFIG_KEYS,GENERATION_CONFIG_KEYS_ADVANCED,GENERATION_CONFIG_SETTINGS} from './generationConfigSettings';export let conversation: Conversation;export let classNames = '';$: modelMaxLength = conversation.model.tokenizerConfig.model_max_length;$: maxTokens = Math.min(modelMaxLength ?? GENERATION_CONFIG_SETTINGS['max_tokens'].max, 64_000);</script><div class="flex flex-col gap-y-5 {classNames}">{#each GENERATION_CONFIG_KEYS as key}{@const { label, min, step } = GENERATION_CONFIG_SETTINGS[key]}{@const max = key === 'max_tokens' ? maxTokens : GENERATION_CONFIG_SETTINGS[key].max}<div><div class="flex items-center justify-between"><labelfor="temperature-range"class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">{label}</label><inputtype="number"class="w-16 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"{min}{max}{step}bind:value={conversation.config[key]}/></div><inputid="temperature-range"type="range"{min}{max}{step}bind:value={conversation.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"/></div>17 unmodified linesmin={settings.min}max={settings.max}step={settings.step}value={conversation.config[key] ?? settings.default}on:input={(e) => (conversation.config[key] = Number(e.currentTarget.value))}/></div><input2 unmodified linesmin={settings.min}max={settings.max}step={settings.step}value={conversation.config[key] ?? settings.default}on:input={(e) => (conversation.config[key] = Number(e.currentTarget.value))}class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700 dark:accent-blue-500"/></div>3 unmodified lines<div class="mt-2"><label class="flex cursor-pointer items-center justify-between"><input type="checkbox" bind:checked={conversation.streaming} class="peer sr-only" /><span class="text-sm font-medium text-gray-900 dark:text-gray-300">Streaming</span><divclass="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:peer-checked:bg-blue-600"
src/lib/components/InferencePlayground/InferencePlayground.svelte+1-4
src/lib/components/InferencePlayground/InferencePlaygroundConversation.svelte+3-3
src/lib/components/InferencePlayground/InferencePlaygroundGenerationConfig.svelte+21-18