Playground
(Beta)
{ if (mode === 'complete') { mode = 'chat'; } else { mode = 'complete'; } }} > {#if mode === 'complete'} Text Completion {:else if mode === 'chat'} Chat {/if}
Select a model
{#each $models as model} {#if model.name === 'hr'}
{:else}
{model.name + `${model.size ? ` (${(model.size / 1024 ** 3).toFixed(1)}GB)` : ''}`}
{/if} {/each}
{#if mode === 'chat'}
System
{/if}
{#if mode === 'complete'}
{:else if mode === 'chat'}
{#each messages as message, idx}
{ message.role = message.role === 'user' ? 'assistant' : 'user'; }}>{message.role}
{ e.target.style.height = ''; e.target.style.height = e.target.scrollHeight + 'px'; }} on:focus={(e) => { e.target.style.height = ''; e.target.style.height = e.target.scrollHeight + 'px'; // e.target.style.height = Math.min(e.target.scrollHeight, 200) + 'px'; }} bind:value={message.content} />
{ messages = messages.filter((message, messageIdx) => messageIdx !== idx); }} >
{/each}
{ console.log(messages.at(-1)); messages.push({ role: (messages.at(-1)?.role ?? 'assistant') === 'user' ? 'assistant' : 'user', content: '' }); messages = messages; }} >
Add message
{/if}
{#if !loading}
{ submitHandler(); }} > Submit
{:else}
{ stopResponse(); }} > Cancel
{/if}