Spaces:
Running on Zero
Running on Zero
Add clickable example prompt chips
Browse files- index.html +23 -0
index.html
CHANGED
|
@@ -81,6 +81,12 @@
|
|
| 81 |
}
|
| 82 |
input[type=range] { accent-color: var(--blue); }
|
| 83 |
#controls b { color: #dfe6f5; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
/* Composer */
|
| 86 |
#composer { padding: 12px 20px 18px; }
|
|
@@ -151,6 +157,13 @@
|
|
| 151 |
<p>A 30B multimodal agentic model — answering questions, reasoning over images and video,<br>and completing tasks, right here on ZeroGPU.</p>
|
| 152 |
</div>
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
<div id="chat"></div>
|
| 155 |
|
| 156 |
<div id="controls">
|
|
@@ -265,6 +278,7 @@ async function send() {
|
|
| 265 |
const text = input.value.trim();
|
| 266 |
if (!text && !attachedFile) return;
|
| 267 |
hero.style.display = "none";
|
|
|
|
| 268 |
document.querySelector(".orb").style.padding = "12px 0 4px";
|
| 269 |
const isVideo = attachedFile && attachedFile.type.startsWith("video/");
|
| 270 |
const mediaUrl = attachedFile ? URL.createObjectURL(attachedFile) : null;
|
|
@@ -311,6 +325,15 @@ sendBtn.onclick = send;
|
|
| 311 |
stopBtn.onclick = () => { if (currentJob) currentJob.cancel(); };
|
| 312 |
input.onkeydown = e => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); send(); } };
|
| 313 |
input.oninput = () => { input.style.height = "auto"; input.style.height = Math.min(input.scrollHeight, 140) + "px"; };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
</script>
|
| 315 |
</body>
|
| 316 |
</html>
|
|
|
|
| 81 |
}
|
| 82 |
input[type=range] { accent-color: var(--blue); }
|
| 83 |
#controls b { color: #dfe6f5; }
|
| 84 |
+
#examples { max-width: 800px; width: 100%; margin: 0 auto; padding: 4px 20px 14px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
|
| 85 |
+
.chip {
|
| 86 |
+
background: var(--card); border: 1px solid var(--border); color: #dfe6f5;
|
| 87 |
+
padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer;
|
| 88 |
+
}
|
| 89 |
+
.chip:hover { border-color: var(--blue); color: #fff; background: #16244a; }
|
| 90 |
|
| 91 |
/* Composer */
|
| 92 |
#composer { padding: 12px 20px 18px; }
|
|
|
|
| 157 |
<p>A 30B multimodal agentic model — answering questions, reasoning over images and video,<br>and completing tasks, right here on ZeroGPU.</p>
|
| 158 |
</div>
|
| 159 |
|
| 160 |
+
<div id="examples">
|
| 161 |
+
<button class="chip" data-text="Write a short joke about saving RAM.">😂 Joke about RAM</button>
|
| 162 |
+
<button class="chip" data-text="Write a Python function to compute Fibonacci numbers with memoization.">🐍 Fibonacci in Python</button>
|
| 163 |
+
<button class="chip" data-text="Explain how speculative decoding works in 3 sentences.">⚡ Speculative decoding</button>
|
| 164 |
+
<button class="chip" data-text="Detect the bridge. Return only the detection in the model's native object-detection format, with no explanation." data-needs-image="true">🌉 Detect the bridge (attach an image)</button>
|
| 165 |
+
<button class="chip" data-text="Describe what happens in this video." data-needs-image="true">🎬 Describe this video (attach a video)</button>
|
| 166 |
+
</div>
|
| 167 |
<div id="chat"></div>
|
| 168 |
|
| 169 |
<div id="controls">
|
|
|
|
| 278 |
const text = input.value.trim();
|
| 279 |
if (!text && !attachedFile) return;
|
| 280 |
hero.style.display = "none";
|
| 281 |
+
document.getElementById("examples").style.display = "none";
|
| 282 |
document.querySelector(".orb").style.padding = "12px 0 4px";
|
| 283 |
const isVideo = attachedFile && attachedFile.type.startsWith("video/");
|
| 284 |
const mediaUrl = attachedFile ? URL.createObjectURL(attachedFile) : null;
|
|
|
|
| 325 |
stopBtn.onclick = () => { if (currentJob) currentJob.cancel(); };
|
| 326 |
input.onkeydown = e => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); send(); } };
|
| 327 |
input.oninput = () => { input.style.height = "auto"; input.style.height = Math.min(input.scrollHeight, 140) + "px"; };
|
| 328 |
+
|
| 329 |
+
document.querySelectorAll(".chip").forEach(chip => {
|
| 330 |
+
chip.onclick = () => {
|
| 331 |
+
input.value = chip.dataset.text;
|
| 332 |
+
input.dispatchEvent(new Event("input"));
|
| 333 |
+
input.focus();
|
| 334 |
+
if (chip.dataset.needsImage) fileInput.click();
|
| 335 |
+
};
|
| 336 |
+
});
|
| 337 |
</script>
|
| 338 |
</body>
|
| 339 |
</html>
|