Spaces:
Runtime error
Runtime error
Added temperature and max tokens controls to the Playground component.
Browse filesFiles changed (2)
18 unmodified lines192021222324252635 unmodified lines6263646364656667686987 unmodified lines15715815915816016116216316416516616718 unmodified lines let currentModel = compatibleModels[0]; let systemMessage: Message = { role: 'system', content: '' }; let messages: Message[] = startMessages; let temperature = 0.5; let maxTokens = 32000;
let loading = false;
35 unmodified lines const out = await hf.chatCompletion({ model: currentModel, messages: systemMessage.content ? [systemMessage, ...messages] : messages, max_tokens: 500, temperature: 0.1, max_tokens: maxTokens, temperature: temperature, seed: 0 });
87 unmodified lines </div> </div> <div class="flex flex-col gap-6 overflow-hidden p-5"> <PlaygroundOptions {compatibleModels} bind:currentModel /> <PlaygroundOptions {compatibleModels} bind:currentModel bind:temperature bind:maxTokens /> </div></div>1234567813 unmodified lines222324232526272628293031323334293536313738394041424344453746474840495051525354554356574558596061626364<script lang="ts"> export let compatibleModels: string[] = []; export let currentModel = compatibleModels[0]; export let temperature = 0.5; export let maxTokens = 32000;</script>
<div>13 unmodified lines</div><div> <div class="flex items-center justify-between"> <label for="default-range" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white" <label for="temperature-range" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white" >Temperature</label > <input type="text" class="w-12 rounded border px-1 py-0.5 text-right text-sm" value="0,5" /> <input type="text" class="w-12 rounded border px-1 py-0.5 text-right text-sm" bind:value={temperature} /> </div> <input id="default-range" id="temperature-range" type="range" value="50" bind:value={temperature} min="0" max="1" step="0.1" class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700" /></div><div> <div class="flex items-center justify-between"> <label for="default-range" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white" <label for="max-tokens-range" class="mb-2 block text-sm font-medium text-gray-900 dark:text-white" >Max tokens</label > <input type="text" class="w-16 rounded border px-1 py-0.5 text-right text-sm" value="32,000" /> <input type="text" class="w-16 rounded border px-1 py-0.5 text-right text-sm" bind:value={maxTokens} /> </div> <input id="default-range" id="max-tokens-range" type="range" value="50" bind:value={maxTokens} min="1" max="32000" step="1" class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700" /></div>src/lib/components/Playground/Playground.svelte+10-3
src/lib/components/Playground/PlaygroundOptions.svelte+24-8