Spaces:
Sleeping
Sleeping
Support config options when running models in comparison (#14)
Browse files
Files changed (2)
1 unmodified line23456743 unmodified lines515253545556574 unmodified lines6263646566671 unmodified lineimport { createEventDispatcher } from 'svelte';import CodeSnippets from '$lib/components/CodeSnippets.svelte';import Message from '$lib/components/Message.svelte';export let loading;export let conversation;43 unmodified lines✕</button><buttonclass=" flex size-6 items-center justify-center rounded bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path4 unmodified linesd="M16 22a6 6 0 1 1 6-6a5.94 5.94 0 0 1-6 6Zm0-10a3.91 3.91 0 0 0-4 4a3.91 3.91 0 0 0 4 4a3.91 3.91 0 0 0 4-4a3.91 3.91 0 0 0-4-4Z"/></svg></button></div>{/if}1 unmodified line234567843 unmodified lines525354555657584 unmodified lines636465666768697071721 unmodified lineimport { createEventDispatcher } from 'svelte';import CodeSnippets from '$lib/components/CodeSnippets.svelte';import Message from '$lib/components/Message.svelte';import PlaygroundOptions from '$lib/components/GenerationConfig.svelte';export let loading;export let conversation;43 unmodified lines✕</button><buttonclass="group relative flex size-6 items-center justify-center rounded bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path4 unmodified linesd="M16 22a6 6 0 1 1 6-6a5.94 5.94 0 0 1-6 6Zm0-10a3.91 3.91 0 0 0-4 4a3.91 3.91 0 0 0 4 4a3.91 3.91 0 0 0 4-4a3.91 3.91 0 0 0-4-4Z"/></svg><PlaygroundOptionsbind:config={conversation.config}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></div>{/if}
4 unmodified lines5678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576774 unmodified lines// export let jsonMode = true;export let config;</script><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">Temperature</label><inputtype="number"class="w-16 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"bind:value={config.temperature}min="0"max="1"step="0.1"/></div><inputid="temperature-range"type="range"bind:value={config.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 dark:accent-blue-500"/></div><div><div class="flex items-center justify-between"><labelfor="max-tokens-range"class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">Max tokens</label><inputtype="number"class="w-20 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"bind:value={config.maxTokens}min="0"max="4096"step="512"/></div><inputid="max-tokens-range"type="range"bind:value={config.maxTokens}min="0"max="4096"step="512"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><div class="mt-2"><label class="flex cursor-pointer items-center justify-between"><input type="checkbox" bind:checked={config.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"></div></label></div><div class="mt-2"><label class="flex cursor-pointer items-center justify-between"><input type="checkbox" value="" class="peer sr-only" disabled bind:checked={config.jsonMode} /><span class="text-sm font-medium text-gray-900 dark:text-gray-300">JSON Mode</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"></div></label></div>4 unmodified lines5678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970714 unmodified lines// export let jsonMode = true;export let config;export let classNames = '';</script><div class={classNames}><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">Temperature</label><inputtype="number"class="w-16 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"bind:value={config.temperature}min="0"max="1"step="0.1"/></div><inputid="temperature-range"type="range"bind:value={config.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 dark:accent-blue-500"/></div><div><div class="flex items-center justify-between"><labelfor="max-tokens-range"class="mb-2 block text-sm font-medium text-gray-900 dark:text-white">Max tokens</label><inputtype="number"class="w-20 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"bind:value={config.maxTokens}min="0"max="4096"step="512"/></div><inputid="max-tokens-range"type="range"bind:value={config.maxTokens}min="0"max="4096"step="512"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><div class="mt-2"><label class="flex cursor-pointer items-center justify-between"><input type="checkbox" bind:checked={config.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"></div></label></div></div>
src/lib/components/Conversation.svelte+6-1
src/lib/components/GenerationConfig.svelte+47-53