compare button
Browse files
src/lib/components/Icons/IconCompare.svelte
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32" class={classNames}
|
6 |
+
><path
|
7 |
+
fill="currentColor"
|
8 |
+
d="M28 6H18V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h10v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2ZM4 15h6.17l-2.58 2.59L9 19l5-5l-5-5l-1.41 1.41L10.17 13H4V4h12v20H4Zm12 13v-2a2 2 0 0 0 2-2V8h10v9h-6.17l2.58-2.59L23 13l-5 5l5 5l1.41-1.41L21.83 19H28v9Z"
|
9 |
+
/></svg
|
10 |
+
>
|
src/lib/components/InferencePlayground/InferencePlayground.svelte
CHANGED
@@ -21,6 +21,7 @@
|
|
21 |
import IconDelete from "../Icons/IconDelete.svelte";
|
22 |
import IconCode from "../Icons/IconCode.svelte";
|
23 |
import IconInfo from "../Icons/IconInfo.svelte";
|
|
|
24 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
25 |
import IconThrashcan from "../Icons/IconThrashcan.svelte";
|
26 |
import { goto } from "$app/navigation";
|
@@ -432,7 +433,14 @@
|
|
432 |
>
|
433 |
<div class="flex flex-col gap-2">
|
434 |
<ModelSelector {models} bind:conversation={session.conversations[0]} />
|
435 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
<a
|
437 |
href="https://huggingface.co/{session.conversations[0].model.id}"
|
438 |
target="_blank"
|
@@ -446,21 +454,6 @@
|
|
446 |
</div>
|
447 |
</div>
|
448 |
|
449 |
-
<button
|
450 |
-
class="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"
|
451 |
-
on:click={() => (selectCompareModelOpen = true)}
|
452 |
-
>
|
453 |
-
Compare with...
|
454 |
-
{#if selectCompareModelOpen}
|
455 |
-
<ModelSelectorModal
|
456 |
-
{models}
|
457 |
-
conversation={session.conversations[0]}
|
458 |
-
on:modelSelected={e => addCompareModel(e.detail)}
|
459 |
-
on:close={() => (selectCompareModelOpen = false)}
|
460 |
-
/>
|
461 |
-
{/if}
|
462 |
-
</button>
|
463 |
-
|
464 |
<GenerationConfig bind:conversation={session.conversations[0]} />
|
465 |
{#if hfToken}
|
466 |
<button
|
@@ -505,3 +498,11 @@
|
|
505 |
<IconInfo classNames="text-xs" />
|
506 |
Give feedback
|
507 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
import IconDelete from "../Icons/IconDelete.svelte";
|
22 |
import IconCode from "../Icons/IconCode.svelte";
|
23 |
import IconInfo from "../Icons/IconInfo.svelte";
|
24 |
+
import IconCompare from "../Icons/IconCompare.svelte";
|
25 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
26 |
import IconThrashcan from "../Icons/IconThrashcan.svelte";
|
27 |
import { goto } from "$app/navigation";
|
|
|
433 |
>
|
434 |
<div class="flex flex-col gap-2">
|
435 |
<ModelSelector {models} bind:conversation={session.conversations[0]} />
|
436 |
+
<div class="flex items-center justify-between gap-2 whitespace-nowrap px-2 text-xs">
|
437 |
+
<button
|
438 |
+
class="flex items-center gap-0.5 text-gray-500 hover:text-gray-700 dark:hover:text-gray-400"
|
439 |
+
on:click={() => (selectCompareModelOpen = true)}
|
440 |
+
>
|
441 |
+
<IconCompare />
|
442 |
+
Compare
|
443 |
+
</button>
|
444 |
<a
|
445 |
href="https://huggingface.co/{session.conversations[0].model.id}"
|
446 |
target="_blank"
|
|
|
454 |
</div>
|
455 |
</div>
|
456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
<GenerationConfig bind:conversation={session.conversations[0]} />
|
458 |
{#if hfToken}
|
459 |
<button
|
|
|
498 |
<IconInfo classNames="text-xs" />
|
499 |
Give feedback
|
500 |
</a>
|
501 |
+
{#if selectCompareModelOpen}
|
502 |
+
<ModelSelectorModal
|
503 |
+
{models}
|
504 |
+
conversation={session.conversations[0]}
|
505 |
+
on:modelSelected={e => addCompareModel(e.detail)}
|
506 |
+
on:close={() => (selectCompareModelOpen = false)}
|
507 |
+
/>
|
508 |
+
{/if}
|
src/lib/components/InferencePlayground/InferencePlaygroundConversationHeader.svelte
CHANGED
@@ -67,7 +67,7 @@
|
|
67 |
<IconCog />
|
68 |
<GenerationConfig
|
69 |
bind:conversation
|
70 |
-
classNames="absolute top-7 min-w-[
|
71 |
/>
|
72 |
</button>
|
73 |
</div>
|
|
|
67 |
<IconCog />
|
68 |
<GenerationConfig
|
69 |
bind:conversation
|
70 |
+
classNames="absolute top-7 min-w-[250px] z-10 right-3 bg-white dark:bg-gray-900 p-4 rounded-xl border border-gray-200 dark:border-gray-600 hidden group-focus:flex hover:flex"
|
71 |
/>
|
72 |
</button>
|
73 |
</div>
|