Spaces:
Runtime error
Runtime error
new ui style
Browse files
src/lib/components/Playground/Playground.svelte
CHANGED
|
@@ -48,8 +48,8 @@
|
|
| 48 |
}
|
| 49 |
// {
|
| 50 |
// id: String(Math.random()),
|
| 51 |
-
// model: '
|
| 52 |
-
// config: { temperature: 0.
|
| 53 |
// messages: startMessages
|
| 54 |
// }
|
| 55 |
];
|
|
@@ -194,17 +194,26 @@
|
|
| 194 |
{/if}
|
| 195 |
|
| 196 |
<div
|
| 197 |
-
class="w-dvh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
>
|
| 199 |
-
<div class="
|
| 200 |
-
<div
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
</div>
|
| 209 |
<div class="relative divide-y divide-gray-200 dark:divide-gray-800">
|
| 210 |
<div
|
|
@@ -220,9 +229,7 @@
|
|
| 220 |
bind:this={messageContainer}
|
| 221 |
>
|
| 222 |
{#if conversations.length > 1}
|
| 223 |
-
<div
|
| 224 |
-
class="flex h-10 items-center bg-gradient-to-r from-gray-50 px-6 text-gray-500 dark:from-gray-400/20"
|
| 225 |
-
>
|
| 226 |
{conversation.model}
|
| 227 |
</div>
|
| 228 |
{/if}
|
|
@@ -354,15 +361,19 @@
|
|
| 354 |
</button>
|
| 355 |
</div>
|
| 356 |
</div>
|
| 357 |
-
|
| 358 |
-
<
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
class="mt-auto flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:border-gray-800 dark:bg-gray-800/50 dark:text-gray-400"
|
| 367 |
role="alert"
|
| 368 |
>
|
|
@@ -374,7 +385,7 @@
|
|
| 374 |
>Get PRO ($9/month)</a
|
| 375 |
>
|
| 376 |
</div> -->
|
| 377 |
-
|
| 378 |
class="flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:bg-gray-800 dark:text-gray-400"
|
| 379 |
role="alert"
|
| 380 |
>
|
|
@@ -386,21 +397,24 @@
|
|
| 386 |
>Deploy dedicated</a
|
| 387 |
>
|
| 388 |
</div> -->
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
|
|
|
| 398 |
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
|
|
|
|
|
|
| 403 |
</div>
|
| 404 |
</div>
|
| 405 |
-
|
| 406 |
</div>
|
|
|
|
| 48 |
}
|
| 49 |
// {
|
| 50 |
// id: String(Math.random()),
|
| 51 |
+
// model: '01-ai/Yi-1.5-34B-Chat',
|
| 52 |
+
// config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },
|
| 53 |
// messages: startMessages
|
| 54 |
// }
|
| 55 |
];
|
|
|
|
| 194 |
{/if}
|
| 195 |
|
| 196 |
<div
|
| 197 |
+
class="w-dvh grid divide-gray-200 overflow-hidden bg-gray-100/50 max-md:divide-y md:h-dvh
|
| 198 |
+
{conversations.length === 1
|
| 199 |
+
? 'md:grid-cols-[clamp(220px,20%,350px),minmax(0,1fr),clamp(270px,25%,300px)]'
|
| 200 |
+
: 'md:grid-cols-[clamp(220px,20%,350px),minmax(0,1fr),0]'}
|
| 201 |
+
|
| 202 |
+
dark:divide-gray-800 dark:bg-gray-900 dark:text-gray-300"
|
| 203 |
>
|
| 204 |
+
<div class=" flex flex-col overflow-y-auto p-3">
|
| 205 |
+
<div
|
| 206 |
+
class="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"
|
| 207 |
+
>
|
| 208 |
+
<div class="pb-2 text-sm font-semibold">SYSTEM</div>
|
| 209 |
+
<textarea
|
| 210 |
+
name=""
|
| 211 |
+
id=""
|
| 212 |
+
placeholder="Enter a custom prompt"
|
| 213 |
+
bind:value={systemMessage.content}
|
| 214 |
+
class="absolute inset-x-0 bottom-0 h-full resize-none bg-transparent px-3 pt-10 text-sm outline-none"
|
| 215 |
+
></textarea>
|
| 216 |
+
</div>
|
| 217 |
</div>
|
| 218 |
<div class="relative divide-y divide-gray-200 dark:divide-gray-800">
|
| 219 |
<div
|
|
|
|
| 229 |
bind:this={messageContainer}
|
| 230 |
>
|
| 231 |
{#if conversations.length > 1}
|
| 232 |
+
<div class="mt-3 flex h-10 items-center px-6 pb-2 text-gray-500">
|
|
|
|
|
|
|
| 233 |
{conversation.model}
|
| 234 |
</div>
|
| 235 |
{/if}
|
|
|
|
| 361 |
</button>
|
| 362 |
</div>
|
| 363 |
</div>
|
| 364 |
+
{#if conversations.length === 1}
|
| 365 |
+
<div class="flex flex-col rounded-xl p-3">
|
| 366 |
+
<div
|
| 367 |
+
class="flex flex-1 flex-col gap-6 overflow-y-hidden rounded-lg 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"
|
| 368 |
+
>
|
| 369 |
+
<PlaygroundModelSelector {compatibleModels} bind:currentModel={currentConversation.model} />
|
| 370 |
+
<PlaygroundOptions
|
| 371 |
+
bind:temperature={currentConversation.config.temperature}
|
| 372 |
+
bind:maxTokens={currentConversation.config.maxTokens}
|
| 373 |
+
bind:jsonMode={currentConversation.config.jsonMode}
|
| 374 |
+
bind:streaming={currentConversation.config.streaming}
|
| 375 |
+
/>
|
| 376 |
+
<!-- <div
|
| 377 |
class="mt-auto flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:border-gray-800 dark:bg-gray-800/50 dark:text-gray-400"
|
| 378 |
role="alert"
|
| 379 |
>
|
|
|
|
| 385 |
>Get PRO ($9/month)</a
|
| 386 |
>
|
| 387 |
</div> -->
|
| 388 |
+
<!-- <div
|
| 389 |
class="flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:bg-gray-800 dark:text-gray-400"
|
| 390 |
role="alert"
|
| 391 |
>
|
|
|
|
| 397 |
>Deploy dedicated</a
|
| 398 |
>
|
| 399 |
</div> -->
|
| 400 |
+
<div class="mt-auto">
|
| 401 |
+
<div class="mb-3 flex items-center justify-between gap-2">
|
| 402 |
+
<label
|
| 403 |
+
for="default-range"
|
| 404 |
+
class="block text-sm font-medium text-gray-900 dark:text-white">API Quota</label
|
| 405 |
+
>
|
| 406 |
+
<span
|
| 407 |
+
class="rounded bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-800 dark:bg-gray-700 dark:text-gray-300"
|
| 408 |
+
>Free</span
|
| 409 |
+
>
|
| 410 |
|
| 411 |
+
<div class="ml-auto w-12 text-right text-sm">76%</div>
|
| 412 |
+
</div>
|
| 413 |
+
<div class="h-2 w-full rounded-full bg-gray-200 dark:bg-gray-700">
|
| 414 |
+
<div class="h-2 rounded-full bg-black dark:bg-gray-400" style="width: 75%"></div>
|
| 415 |
+
</div>
|
| 416 |
+
</div>
|
| 417 |
</div>
|
| 418 |
</div>
|
| 419 |
+
{/if}
|
| 420 |
</div>
|