Spaces:
Running
Running
Commit
·
f6f47e4
1
Parent(s):
9126f16
update content
Browse files- README.md +1 -0
- src/routes/+page.svelte +11 -6
README.md
CHANGED
@@ -5,6 +5,7 @@ colorFrom: green
|
|
5 |
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
license: mit
|
9 |
app_port: 3000
|
10 |
---
|
|
|
5 |
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
+
short_description: Run the finetuned SmolLM-360M in realtime with WebLLM
|
9 |
license: mit
|
10 |
app_port: 3000
|
11 |
---
|
src/routes/+page.svelte
CHANGED
@@ -19,10 +19,10 @@
|
|
19 |
|
20 |
const promptExamples = [
|
21 |
"Tell me a story about a cat.",
|
22 |
-
"Write a poem about the ocean.",
|
23 |
"What is refraction?",
|
24 |
"Explain thermal conductivity",
|
25 |
"What is Newton's first law of motion?",
|
|
|
26 |
]
|
27 |
|
28 |
async function setPrompt(prompt: string) {
|
@@ -91,8 +91,8 @@
|
|
91 |
|
92 |
outputText = response.choices[0].message.content || "";
|
93 |
|
94 |
-
// indicate that the response was cut short
|
95 |
-
if (response.choices[0].finish_reason === "length") {
|
96 |
outputText += "...";
|
97 |
}
|
98 |
|
@@ -121,9 +121,14 @@
|
|
121 |
onMount(loadWebLLM);
|
122 |
</script>
|
123 |
|
124 |
-
<div class="flex my-20 flex-col items-center gap-4 max-w-
|
125 |
<h1 class="text-center font-mono font-bold text-4xl">SmolLM 🤗</h1>
|
126 |
-
<p class="text-center font-mono text-sm mb-4">
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
<Textarea
|
129 |
bind:value={inputText}
|
@@ -132,7 +137,7 @@
|
|
132 |
class="w-full text-lg"
|
133 |
placeholder="Say something..."
|
134 |
/>
|
135 |
-
<p class="text-center text-xs italic">This is a smol model, go easy on it.</p>
|
136 |
{#if isLoading}
|
137 |
<p class="text-sm text-slate-600 text-center">{loadingStatus}</p>
|
138 |
{:else if error}
|
|
|
19 |
|
20 |
const promptExamples = [
|
21 |
"Tell me a story about a cat.",
|
|
|
22 |
"What is refraction?",
|
23 |
"Explain thermal conductivity",
|
24 |
"What is Newton's first law of motion?",
|
25 |
+
"How do I make everything uppercase in Python?",
|
26 |
]
|
27 |
|
28 |
async function setPrompt(prompt: string) {
|
|
|
91 |
|
92 |
outputText = response.choices[0].message.content || "";
|
93 |
|
94 |
+
// indicate that the response was cut short if it doesn't end with a period
|
95 |
+
if (response.choices[0].finish_reason === "length" && outputText[outputText.length - 1] !== ".") {
|
96 |
outputText += "...";
|
97 |
}
|
98 |
|
|
|
121 |
onMount(loadWebLLM);
|
122 |
</script>
|
123 |
|
124 |
+
<div class="flex my-20 flex-col items-center gap-4 max-w-2xl mx-auto">
|
125 |
<h1 class="text-center font-mono font-bold text-4xl">SmolLM 🤗</h1>
|
126 |
+
<p class="text-center font-mono text-sm mb-4">
|
127 |
+
Powered by <a href="https://huggingface.co/mlc-ai" target="_blank" class="underline text-blue-500">MLC</a>,
|
128 |
+
<a href="https://github.com/mlc-ai/web-llm" target="_blank" class="underline text-blue-500">WebLLM</a>, and
|
129 |
+
<a class="underline text-blue-500" href="https://huggingface.co/HuggingFaceTB/smollm-360M-instruct-add-basics" target="_blank">SmolLM-360M-Instruct-Add-Basics</a>
|
130 |
+
<span class="text-xs italic">(15 Max Tokens)</span>
|
131 |
+
</p>
|
132 |
|
133 |
<Textarea
|
134 |
bind:value={inputText}
|
|
|
137 |
class="w-full text-lg"
|
138 |
placeholder="Say something..."
|
139 |
/>
|
140 |
+
<p class="text-center text-xs italic">This is a smol model, go easy on it. Check out <a href="https://huggingface.co/spaces/HuggingFaceTB/SmolLM-360M-Instruct-WebGPU" target="_blank" class="underline text-blue-500">this demo</a> for full conversations.</p>
|
141 |
{#if isLoading}
|
142 |
<p class="text-sm text-slate-600 text-center">{loadingStatus}</p>
|
143 |
{:else if error}
|