Spaces:
Sleeping
Sleeping
compare with
Browse files44 unmodified lines454647484950515253545556144 unmodified lines20120220320420520620720820920 unmodified lines23023123223323423523623723823924024124224324424524624724813 unmodified lines262263264265266267268122 unmodified lines39139239339439539644 unmodified linesmodel: '01-ai/Yi-1.5-34B-Chat',config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },messages: startMessages},{id: String(Math.random()),model: 'google/gemma-1.1-2b-it',config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },messages: startMessages}];144 unmodified linesdark:divide-gray-800 dark:bg-gray-900 dark:text-gray-300"><div class=" flex flex-col overflow-y-auto p-3"><divclass="relative flex flex-1 flex-col gap-6 overflow-y-hidden rounded-xl border border-gray-200/80 bg-gradient-to-b from-white via-white p-3 shadow-sm dark:border-white/5 dark:from-gray-800/40 dark:via-gray-800/40"><div class="pb-2 text-sm font-semibold">SYSTEM</div><textarea20 unmodified lines>{#if conversations.length > 1}<divclass="flex h-10 flex-none items-center gap-1.5 whitespace-nowrap rounded-lg border border-gray-200/80 bg-white px-3 text-sm leading-none shadow-sm"class:mr-3={index === 0}class:mx-3={index === 1}><div class="size-3.5 rounded bg-black"></div><div>{conversation.model}</div><buttonclass="ml-auto flex size-6 items-center justify-center rounded border text-xs hover:bg-gray-50">✕</button><buttonclass=" flex size-6 items-center justify-center rounded border hover:bg-gray-50"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path13 unmodified linesclass="border-b"{message}on:delete={() => deleteMessage(i)}autofocus={!loading && i === messages.length - 1}/>{/each}122 unmodified linesclass="flex flex-1 flex-col gap-6 overflow-y-hidden rounded-xl border border-gray-200/80 bg-gradient-to-b from-white via-white p-3 shadow-sm dark:border-white/5 dark:from-gray-800/40 dark:via-gray-800/40"><PlaygroundModelSelector {compatibleModels} bind:currentModel={currentConversation.model} /><PlaygroundOptionsbind:temperature={currentConversation.config.temperature}bind:maxTokens={currentConversation.config.maxTokens}44 unmodified lines454647484950144 unmodified lines19519619719819920020120220320 unmodified lines22422522622722822923023123223323423523623723823924024124224313 unmodified lines257258259260261262263122 unmodified lines38638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943044 unmodified linesmodel: '01-ai/Yi-1.5-34B-Chat',config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },messages: startMessages}];144 unmodified linesdark:divide-gray-800 dark:bg-gray-900 dark:text-gray-300"><div class=" flex flex-col overflow-y-auto py-3 pr-3"><divclass="relative flex flex-1 flex-col gap-6 overflow-y-hidden rounded-r-xl border-x border-y border-gray-200/80 bg-gradient-to-b from-white via-white p-3 shadow-sm dark:border-white/5 dark:from-gray-800/40 dark:via-gray-800/40"><div class="pb-2 text-sm font-semibold">SYSTEM</div><textarea20 unmodified lines>{#if conversations.length > 1}<divclass="flex h-10 flex-none items-center gap-1.5 whitespace-nowrap rounded-lg border border-gray-200/80 bg-white pl-3 pr-2 text-sm leading-none shadow-sm *:flex-none"class:mr-3={index === 0}class:mx-3={index === 1}><div class="size-3.5 rounded bg-black"></div><div>{conversation.model}</div><buttonclass="ml-auto flex size-6 items-center justify-center rounded bg-gray-50 text-xs hover:bg-gray-100"on:click={() => (conversations = conversations.filter((_, i) => i !== index))}>✕</button><buttonclass=" flex size-6 items-center justify-center rounded bg-gray-50 hover:bg-gray-100"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path13 unmodified linesclass="border-b"{message}on:delete={() => deleteMessage(i)}autofocus={conversations.length === 1 && !loading && i === messages.length - 1}/>{/each}122 unmodified linesclass="flex flex-1 flex-col gap-6 overflow-y-hidden rounded-xl border border-gray-200/80 bg-gradient-to-b from-white via-white p-3 shadow-sm dark:border-white/5 dark:from-gray-800/40 dark:via-gray-800/40"><PlaygroundModelSelector {compatibleModels} bind:currentModel={currentConversation.model} /><divclass="group relative -mt-4 flex h-[26px] w-full items-center justify-center gap-2 rounded-lg bg-black px-5 text-sm text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700">Compare with...<svgclass="ml-0.5 flex-none opacity-50 group-hover:opacity-100"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"aria-hidden="true"role="img"width="1em"height="1em"preserveAspectRatio="xMidYMid meet"viewBox="0 0 24 24"><pathd="M16.293 9.293L12 13.586L7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"fill="currentColor"></path></svg><selectclass="absolute inset-0 border-none bg-white text-base opacity-0 outline-none"on:change|preventDefault={(e) => {conversations = [...conversations,{id: String(Math.random()),model: e.target.value,config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },messages: startMessages}];}}>{#each compatibleModels as model}<option value={model}>{model}</option>{/each}</select></div><PlaygroundOptionsbind:temperature={currentConversation.config.temperature}bind:maxTokens={currentConversation.config.maxTokens}
src/lib/components/Playground/Playground.svelte+46-12