Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
8b09a5e
1
Parent(s):
0c58a67
fix code snippets
Browse files
src/lib/components/inference-playground/code-snippets.svelte
CHANGED
|
@@ -17,6 +17,7 @@
|
|
| 17 |
type GetInferenceSnippetReturn,
|
| 18 |
type InferenceSnippetLanguage,
|
| 19 |
} from "./utils.svelte.js";
|
|
|
|
| 20 |
|
| 21 |
hljs.registerLanguage("javascript", javascript);
|
| 22 |
hljs.registerLanguage("python", python);
|
|
@@ -53,8 +54,12 @@
|
|
| 53 |
max_tokens: data.config.max_tokens,
|
| 54 |
temperature: data.config.temperature,
|
| 55 |
top_p: data.config.top_p,
|
| 56 |
-
|
| 57 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
if (isCustomModel(model)) {
|
| 60 |
const snippets = getInferenceSnippet(
|
|
|
|
| 17 |
type GetInferenceSnippetReturn,
|
| 18 |
type InferenceSnippetLanguage,
|
| 19 |
} from "./utils.svelte.js";
|
| 20 |
+
import { structuredForbiddenProviders } from "$lib/state/models.svelte";
|
| 21 |
|
| 22 |
hljs.registerLanguage("javascript", javascript);
|
| 23 |
hljs.registerLanguage("python", python);
|
|
|
|
| 54 |
max_tokens: data.config.max_tokens,
|
| 55 |
temperature: data.config.temperature,
|
| 56 |
top_p: data.config.top_p,
|
| 57 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 58 |
+
} as any;
|
| 59 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 60 |
+
if (data.structuredOutput && !structuredForbiddenProviders.includes(conversation.data.provider as any)) {
|
| 61 |
+
opts.structured_output = data.structuredOutput;
|
| 62 |
+
}
|
| 63 |
|
| 64 |
if (isCustomModel(model)) {
|
| 65 |
const snippets = getInferenceSnippet(
|