order imports
Browse files- src/lib/components/InferencePlayground/InferencePlayground.svelte +6 -4
- src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte +4 -2
- src/lib/components/InferencePlayground/InferencePlaygroundConversation.svelte +3 -1
- src/lib/components/InferencePlayground/InferencePlaygroundGenerationConfig.svelte +1 -0
- src/lib/components/InferencePlayground/InferencePlaygroundHFTokenModal.svelte +3 -2
- src/lib/components/InferencePlayground/InferencePlaygroundMessage.svelte +1 -1
- src/lib/components/InferencePlayground/InferencePlaygroundModelSelector.svelte +1 -0
- src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte +2 -0
src/lib/components/InferencePlayground/InferencePlayground.svelte
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<script lang="ts">
|
|
|
|
|
|
|
|
|
2 |
import {
|
3 |
createHfInference,
|
4 |
handleStreamingResponse,
|
5 |
handleNonStreamingResponse,
|
6 |
isSystemPromptSupported,
|
7 |
} from "./inferencePlaygroundUtils";
|
|
|
|
|
8 |
import GenerationConfig from "./InferencePlaygroundGenerationConfig.svelte";
|
9 |
import HFTokenModal from "./InferencePlaygroundHFTokenModal.svelte";
|
10 |
import ModelSelector from "./InferencePlaygroundModelSelector.svelte";
|
11 |
import Conversation from "./InferencePlaygroundConversation.svelte";
|
12 |
-
import { onDestroy } from "svelte";
|
13 |
-
import { type ChatCompletionInputMessage } from "@huggingface/tasks";
|
14 |
-
import type { ModelEntryWithTokenizer } from "$lib/types";
|
15 |
-
import { defaultGenerationConfig } from "./generationConfigSettings";
|
16 |
import IconShare from "../Icons/IconShare.svelte";
|
17 |
import IconDelete from "../Icons/IconDelete.svelte";
|
18 |
import IconCode from "../Icons/IconCode.svelte";
|
|
|
1 |
<script lang="ts">
|
2 |
+
import type { ModelEntryWithTokenizer } from "$lib/types";
|
3 |
+
import { type ChatCompletionInputMessage } from "@huggingface/tasks";
|
4 |
+
|
5 |
+
import { defaultGenerationConfig } from "./generationConfigSettings";
|
6 |
import {
|
7 |
createHfInference,
|
8 |
handleStreamingResponse,
|
9 |
handleNonStreamingResponse,
|
10 |
isSystemPromptSupported,
|
11 |
} from "./inferencePlaygroundUtils";
|
12 |
+
|
13 |
+
import { onDestroy } from "svelte";
|
14 |
import GenerationConfig from "./InferencePlaygroundGenerationConfig.svelte";
|
15 |
import HFTokenModal from "./InferencePlaygroundHFTokenModal.svelte";
|
16 |
import ModelSelector from "./InferencePlaygroundModelSelector.svelte";
|
17 |
import Conversation from "./InferencePlaygroundConversation.svelte";
|
|
|
|
|
|
|
|
|
18 |
import IconShare from "../Icons/IconShare.svelte";
|
19 |
import IconDelete from "../Icons/IconDelete.svelte";
|
20 |
import IconCode from "../Icons/IconCode.svelte";
|
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
<script lang="ts">
|
|
|
|
|
|
|
2 |
import hljs from "highlight.js/lib/core";
|
3 |
import javascript from "highlight.js/lib/languages/javascript";
|
4 |
import python from "highlight.js/lib/languages/python";
|
5 |
import http from "highlight.js/lib/languages/http";
|
6 |
-
|
7 |
import IconCopyCode from "../Icons/IconCopyCode.svelte";
|
8 |
-
import { onDestroy } from "svelte";
|
9 |
|
10 |
hljs.registerLanguage("javascript", javascript);
|
11 |
hljs.registerLanguage("python", python);
|
|
|
1 |
<script lang="ts">
|
2 |
+
import type { Conversation } from "$lib/types";
|
3 |
+
|
4 |
+
import { onDestroy } from "svelte";
|
5 |
import hljs from "highlight.js/lib/core";
|
6 |
import javascript from "highlight.js/lib/languages/javascript";
|
7 |
import python from "highlight.js/lib/languages/python";
|
8 |
import http from "highlight.js/lib/languages/http";
|
9 |
+
|
10 |
import IconCopyCode from "../Icons/IconCopyCode.svelte";
|
|
|
11 |
|
12 |
hljs.registerLanguage("javascript", javascript);
|
13 |
hljs.registerLanguage("python", python);
|
src/lib/components/InferencePlayground/InferencePlaygroundConversation.svelte
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<script lang="ts">
|
|
|
|
|
2 |
import { createEventDispatcher } from "svelte";
|
|
|
3 |
import CodeSnippets from "./InferencePlaygroundCodeSnippets.svelte";
|
4 |
import Message from "./InferencePlaygroundMessage.svelte";
|
5 |
import IconPlus from "../Icons/IconPlus.svelte";
|
6 |
-
import type { Conversation } from "$lib/types";
|
7 |
|
8 |
export let loading;
|
9 |
export let conversation: Conversation;
|
|
|
1 |
<script lang="ts">
|
2 |
+
import type { Conversation } from "$lib/types";
|
3 |
+
|
4 |
import { createEventDispatcher } from "svelte";
|
5 |
+
|
6 |
import CodeSnippets from "./InferencePlaygroundCodeSnippets.svelte";
|
7 |
import Message from "./InferencePlaygroundMessage.svelte";
|
8 |
import IconPlus from "../Icons/IconPlus.svelte";
|
|
|
9 |
|
10 |
export let loading;
|
11 |
export let conversation: Conversation;
|
src/lib/components/InferencePlayground/InferencePlaygroundGenerationConfig.svelte
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<script lang="ts">
|
2 |
import type { Conversation } from "$lib/types";
|
|
|
3 |
import {
|
4 |
GENERATION_CONFIG_KEYS,
|
5 |
GENERATION_CONFIG_KEYS_ADVANCED,
|
|
|
1 |
<script lang="ts">
|
2 |
import type { Conversation } from "$lib/types";
|
3 |
+
|
4 |
import {
|
5 |
GENERATION_CONFIG_KEYS,
|
6 |
GENERATION_CONFIG_KEYS_ADVANCED,
|
src/lib/components/InferencePlayground/InferencePlaygroundHFTokenModal.svelte
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
<!-- Main modal -->
|
2 |
<script lang="ts">
|
3 |
-
import { createEventDispatcher, onDestroy, onMount } from "svelte";
|
4 |
import { browser } from "$app/environment";
|
|
|
|
|
|
|
5 |
import IconCross from "../Icons/IconCross.svelte";
|
6 |
|
7 |
let backdropEl: HTMLDivElement;
|
|
|
|
|
1 |
<script lang="ts">
|
|
|
2 |
import { browser } from "$app/environment";
|
3 |
+
|
4 |
+
import { createEventDispatcher, onDestroy, onMount } from "svelte";
|
5 |
+
|
6 |
import IconCross from "../Icons/IconCross.svelte";
|
7 |
|
8 |
let backdropEl: HTMLDivElement;
|
src/lib/components/InferencePlayground/InferencePlaygroundMessage.svelte
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<script lang="ts">
|
2 |
-
import { createEventDispatcher } from "svelte";
|
3 |
import { type ChatCompletionInputMessage } from "@huggingface/tasks";
|
|
|
4 |
|
5 |
export let message: ChatCompletionInputMessage;
|
6 |
export let autofocus: boolean = false;
|
|
|
1 |
<script lang="ts">
|
|
|
2 |
import { type ChatCompletionInputMessage } from "@huggingface/tasks";
|
3 |
+
import { createEventDispatcher } from "svelte";
|
4 |
|
5 |
export let message: ChatCompletionInputMessage;
|
6 |
export let autofocus: boolean = false;
|
src/lib/components/InferencePlayground/InferencePlaygroundModelSelector.svelte
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<script lang="ts">
|
2 |
import type { Conversation, ModelEntryWithTokenizer } from "$lib/types";
|
|
|
3 |
import IconCaret from "../Icons/IconCaret.svelte";
|
4 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
5 |
|
|
|
1 |
<script lang="ts">
|
2 |
import type { Conversation, ModelEntryWithTokenizer } from "$lib/types";
|
3 |
+
|
4 |
import IconCaret from "../Icons/IconCaret.svelte";
|
5 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
6 |
|
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<script lang="ts">
|
2 |
import type { ModelEntryWithTokenizer } from "$lib/types";
|
|
|
3 |
import { createEventDispatcher } from "svelte";
|
|
|
4 |
import IconSearch from "../Icons/IconSearch.svelte";
|
5 |
import IconStar from "../Icons/IconStar.svelte";
|
6 |
|
|
|
1 |
<script lang="ts">
|
2 |
import type { ModelEntryWithTokenizer } from "$lib/types";
|
3 |
+
|
4 |
import { createEventDispatcher } from "svelte";
|
5 |
+
|
6 |
import IconSearch from "../Icons/IconSearch.svelte";
|
7 |
import IconStar from "../Icons/IconStar.svelte";
|
8 |
|