Spaces:
Runtime error
Runtime error
Thomas G. Lopes
commited on
Commit
·
f9e5aae
1
Parent(s):
f33fa43
change share position
Browse files
src/lib/components/inference-playground/playground.svelte
CHANGED
|
@@ -9,12 +9,17 @@
|
|
| 9 |
import { token } from "$lib/state/token.svelte.js";
|
| 10 |
import { isMac } from "$lib/utils/platform.js";
|
| 11 |
import { HfInference } from "@huggingface/inference";
|
|
|
|
| 12 |
import IconExternal from "~icons/carbon/arrow-up-right";
|
| 13 |
-
import IconSettings from "~icons/carbon/settings";
|
| 14 |
import IconCode from "~icons/carbon/code";
|
| 15 |
import IconCompare from "~icons/carbon/compare";
|
| 16 |
import IconInfo from "~icons/carbon/information";
|
|
|
|
|
|
|
| 17 |
import { default as IconDelete } from "~icons/carbon/trash-can";
|
|
|
|
|
|
|
|
|
|
| 18 |
import { addToast } from "../toaster.svelte.js";
|
| 19 |
import PlaygroundConversationHeader from "./conversation-header.svelte";
|
| 20 |
import PlaygroundConversation from "./conversation.svelte";
|
|
@@ -23,9 +28,6 @@
|
|
| 23 |
import ModelSelectorModal from "./model-selector-modal.svelte";
|
| 24 |
import ModelSelector from "./model-selector.svelte";
|
| 25 |
import ProjectSelect from "./project-select.svelte";
|
| 26 |
-
import { showQuotaModal } from "../quota-modal.svelte";
|
| 27 |
-
import Toaster from "../toaster.svelte";
|
| 28 |
-
import typia from "typia";
|
| 29 |
|
| 30 |
const startMessageUser: ConversationMessage = { role: "user", content: "" };
|
| 31 |
|
|
@@ -364,22 +366,35 @@
|
|
| 364 |
</div>
|
| 365 |
|
| 366 |
<GenerationConfig bind:conversation={session.project.conversations[0]!} />
|
| 367 |
-
|
|
|
|
| 368 |
<button
|
| 369 |
-
onclick={
|
| 370 |
-
class="
|
| 371 |
-
><svg xmlns="http://www.w3.org/2000/svg" class="text-xs" width="1em" height="1em" viewBox="0 0 32 32"
|
| 372 |
-
><path
|
| 373 |
-
fill="currentColor"
|
| 374 |
-
d="M23.216 4H26V2h-7v6h2V5.096A11.96 11.96 0 0 1 28 16c0 6.617-5.383 12-12 12v2c7.72 0 14-6.28 14-14c0-5.009-2.632-9.512-6.784-12"
|
| 375 |
-
/><path fill="currentColor" d="M16 20a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3M15 9h2v9h-2z" /><path
|
| 376 |
-
fill="currentColor"
|
| 377 |
-
d="M16 4V2C8.28 2 2 8.28 2 16c0 4.977 2.607 9.494 6.784 12H6v2h7v-6h-2v2.903A11.97 11.97 0 0 1 4 16C4 9.383 9.383 4 16 4"
|
| 378 |
-
/></svg
|
| 379 |
-
>
|
| 380 |
-
Reset token</button
|
| 381 |
>
|
| 382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
<div class="mt-auto hidden">
|
| 384 |
<div class="mb-3 flex items-center justify-between gap-2">
|
| 385 |
<label for="default-range" class="block text-sm font-medium text-gray-900 dark:text-white">API Quota</label>
|
|
|
|
| 9 |
import { token } from "$lib/state/token.svelte.js";
|
| 10 |
import { isMac } from "$lib/utils/platform.js";
|
| 11 |
import { HfInference } from "@huggingface/inference";
|
| 12 |
+
import typia from "typia";
|
| 13 |
import IconExternal from "~icons/carbon/arrow-up-right";
|
|
|
|
| 14 |
import IconCode from "~icons/carbon/code";
|
| 15 |
import IconCompare from "~icons/carbon/compare";
|
| 16 |
import IconInfo from "~icons/carbon/information";
|
| 17 |
+
import IconSettings from "~icons/carbon/settings";
|
| 18 |
+
import IconShare from "~icons/carbon/share";
|
| 19 |
import { default as IconDelete } from "~icons/carbon/trash-can";
|
| 20 |
+
import { showQuotaModal } from "../quota-modal.svelte";
|
| 21 |
+
import { showShareModal } from "../share-modal.svelte";
|
| 22 |
+
import Toaster from "../toaster.svelte";
|
| 23 |
import { addToast } from "../toaster.svelte.js";
|
| 24 |
import PlaygroundConversationHeader from "./conversation-header.svelte";
|
| 25 |
import PlaygroundConversation from "./conversation.svelte";
|
|
|
|
| 28 |
import ModelSelectorModal from "./model-selector-modal.svelte";
|
| 29 |
import ModelSelector from "./model-selector.svelte";
|
| 30 |
import ProjectSelect from "./project-select.svelte";
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
const startMessageUser: ConversationMessage = { role: "user", content: "" };
|
| 33 |
|
|
|
|
| 366 |
</div>
|
| 367 |
|
| 368 |
<GenerationConfig bind:conversation={session.project.conversations[0]!} />
|
| 369 |
+
|
| 370 |
+
<div class="mt-auto flex items-center justify-end gap-4">
|
| 371 |
<button
|
| 372 |
+
onclick={() => showShareModal(session.project)}
|
| 373 |
+
class="flex items-center gap-1 text-sm text-gray-500 underline decoration-gray-300 hover:text-gray-800 dark:text-gray-400 dark:decoration-gray-600 dark:hover:text-gray-200"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 374 |
>
|
| 375 |
+
<IconShare class="text-xs" />
|
| 376 |
+
Share
|
| 377 |
+
</button>
|
| 378 |
+
{#if token.value}
|
| 379 |
+
<button
|
| 380 |
+
onclick={token.reset}
|
| 381 |
+
class="flex items-center gap-1 text-sm text-gray-500 underline decoration-gray-300 hover:text-gray-800 dark:text-gray-400 dark:decoration-gray-600 dark:hover:text-gray-200"
|
| 382 |
+
>
|
| 383 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="text-xs" width="1em" height="1em" viewBox="0 0 32 32">
|
| 384 |
+
<path
|
| 385 |
+
fill="currentColor"
|
| 386 |
+
d="M23.216 4H26V2h-7v6h2V5.096A11.96 11.96 0 0 1 28 16c0 6.617-5.383 12-12 12v2c7.72 0 14-6.28 14-14c0-5.009-2.632-9.512-6.784-12"
|
| 387 |
+
/>
|
| 388 |
+
<path fill="currentColor" d="M16 20a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3M15 9h2v9h-2z" /><path
|
| 389 |
+
fill="currentColor"
|
| 390 |
+
d="M16 4V2C8.28 2 2 8.28 2 16c0 4.977 2.607 9.494 6.784 12H6v2h7v-6h-2v2.903A11.97 11.97 0 0 1 4 16C4 9.383 9.383 4 16 4"
|
| 391 |
+
/>
|
| 392 |
+
</svg>
|
| 393 |
+
Reset token
|
| 394 |
+
</button>
|
| 395 |
+
{/if}
|
| 396 |
+
</div>
|
| 397 |
+
|
| 398 |
<div class="mt-auto hidden">
|
| 399 |
<div class="mb-3 flex items-center justify-between gap-2">
|
| 400 |
<label for="default-range" class="block text-sm font-medium text-gray-900 dark:text-white">API Quota</label>
|
src/lib/components/inference-playground/project-select.svelte
CHANGED
|
@@ -52,14 +52,6 @@
|
|
| 52 |
</button>
|
| 53 |
|
| 54 |
<div class="flex items-center gap-2">
|
| 55 |
-
<Tooltip>
|
| 56 |
-
{#snippet trigger(tooltip)}
|
| 57 |
-
<button class="btn size-[32px] p-0" {...tooltip.trigger} onclick={() => showShareModal(session.project)}>
|
| 58 |
-
<IconShare />
|
| 59 |
-
</button>
|
| 60 |
-
{/snippet}
|
| 61 |
-
Share options
|
| 62 |
-
</Tooltip>
|
| 63 |
{#if isDefault}
|
| 64 |
<Tooltip>
|
| 65 |
{#snippet trigger(tooltip)}
|
|
|
|
| 52 |
</button>
|
| 53 |
|
| 54 |
<div class="flex items-center gap-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
{#if isDefault}
|
| 56 |
<Tooltip>
|
| 57 |
{#snippet trigger(tooltip)}
|