Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
7716903
1
Parent(s):
ba9894c
eslint fix
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
import type { Conversation
|
| 3 |
|
| 4 |
import { createEventDispatcher, tick } from "svelte";
|
| 5 |
|
| 6 |
-
import {
|
| 7 |
import IconSearch from "../Icons/IconSearch.svelte";
|
| 8 |
import IconStar from "../Icons/IconStar.svelte";
|
| 9 |
-
import {
|
| 10 |
|
| 11 |
export let conversation: Conversation;
|
| 12 |
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import type { Conversation } from "./types";
|
| 3 |
|
| 4 |
import { createEventDispatcher, tick } from "svelte";
|
| 5 |
|
| 6 |
+
import { models } from "$lib/stores/models";
|
| 7 |
import IconSearch from "../Icons/IconSearch.svelte";
|
| 8 |
import IconStar from "../Icons/IconStar.svelte";
|
| 9 |
+
import { FEATURED_MODELS_IDS } from "./inferencePlaygroundUtils";
|
| 10 |
|
| 11 |
export let conversation: Conversation;
|
| 12 |
|
src/lib/components/InferencePlayground/inferencePlaygroundUtils.ts
CHANGED
|
@@ -49,7 +49,8 @@ export async function handleNonStreamingResponse(
|
|
| 49 |
});
|
| 50 |
|
| 51 |
if (response.choices && response.choices.length > 0) {
|
| 52 |
-
|
|
|
|
| 53 |
const { completion_tokens } = response.usage;
|
| 54 |
return { message, completion_tokens };
|
| 55 |
}
|
|
|
|
| 49 |
});
|
| 50 |
|
| 51 |
if (response.choices && response.choices.length > 0) {
|
| 52 |
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
| 53 |
+
const { message } = response.choices[0]!;
|
| 54 |
const { completion_tokens } = response.usage;
|
| 55 |
return { message, completion_tokens };
|
| 56 |
}
|
src/lib/components/InferencePlayground/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import type { GenerationConfig } from "$lib/components/InferencePlayground/generationConfigSettings";
|
| 2 |
-
import type { Provider } from "$lib/fetchers/providers";
|
| 3 |
import type { ModelEntry } from "@huggingface/hub";
|
| 4 |
import type { ChatCompletionInputMessage } from "@huggingface/tasks";
|
| 5 |
|
|
|
|
| 1 |
import type { GenerationConfig } from "$lib/components/InferencePlayground/generationConfigSettings";
|
|
|
|
| 2 |
import type { ModelEntry } from "@huggingface/hub";
|
| 3 |
import type { ChatCompletionInputMessage } from "@huggingface/tasks";
|
| 4 |
|