Thomas G. Lopes
commited on
Commit
·
a379843
1
Parent(s):
b7dc03e
fix slider bug
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte
CHANGED
@@ -48,7 +48,7 @@
|
|
48 |
messages: conversation.messages,
|
49 |
streaming: conversation.streaming,
|
50 |
max_tokens: conversation.config.max_tokens,
|
51 |
-
|
52 |
top_p: conversation.config.top_p,
|
53 |
});
|
54 |
}
|
|
|
48 |
messages: conversation.messages,
|
49 |
streaming: conversation.streaming,
|
50 |
max_tokens: conversation.config.max_tokens,
|
51 |
+
temperature: conversation.config.temperature,
|
52 |
top_p: conversation.config.top_p,
|
53 |
});
|
54 |
}
|
src/lib/components/InferencePlayground/InferencePlaygroundProviderSelect.svelte
CHANGED
@@ -88,7 +88,7 @@
|
|
88 |
</button>
|
89 |
|
90 |
<div {...$menu} use:menu class="rounded-lg border bg-gray-100/80 dark:border-gray-700 dark:bg-gray-800">
|
91 |
-
{#each conversation.model.inferenceProviderMapping as { provider }}
|
92 |
<button {...$option({ value: provider })} use:option class="group block w-full p-1 text-sm dark:text-white">
|
93 |
<div
|
94 |
class="flex items-center gap-2 rounded-md px-2 py-1.5 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
|
|
88 |
</button>
|
89 |
|
90 |
<div {...$menu} use:menu class="rounded-lg border bg-gray-100/80 dark:border-gray-700 dark:bg-gray-800">
|
91 |
+
{#each conversation.model.inferenceProviderMapping as { provider } (provider)}
|
92 |
<button {...$option({ value: provider })} use:option class="group block w-full p-1 text-sm dark:text-white">
|
93 |
<div
|
94 |
class="flex items-center gap-2 rounded-md px-2 py-1.5 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
src/lib/stores/session.ts
CHANGED
@@ -68,6 +68,7 @@ function createSessionStore() {
|
|
68 |
});
|
69 |
|
70 |
const update: typeof store.update = cb => {
|
|
|
71 |
const query = new URLSearchParams(window.location.search);
|
72 |
query.delete("modelId");
|
73 |
query.delete("provider");
|
@@ -81,7 +82,12 @@ function createSessionStore() {
|
|
81 |
const providers = s.conversations.map(c => c.provider ?? "hf-inference");
|
82 |
providers.forEach(p => query.append("provider", p));
|
83 |
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
return s;
|
87 |
});
|
|
|
68 |
});
|
69 |
|
70 |
const update: typeof store.update = cb => {
|
71 |
+
const prevQuery = window.location.search;
|
72 |
const query = new URLSearchParams(window.location.search);
|
73 |
query.delete("modelId");
|
74 |
query.delete("provider");
|
|
|
82 |
const providers = s.conversations.map(c => c.provider ?? "hf-inference");
|
83 |
providers.forEach(p => query.append("provider", p));
|
84 |
|
85 |
+
const newQuery = query.toString();
|
86 |
+
// slice to remove the ? prefix
|
87 |
+
if (newQuery !== prevQuery.slice(1)) {
|
88 |
+
console.log(prevQuery, newQuery);
|
89 |
+
goto(`?${query}`, { replaceState: true });
|
90 |
+
}
|
91 |
|
92 |
return s;
|
93 |
});
|