Spaces:
Running
Running
| <!-- index.html content here --> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Gemma Chatbot - Transformers.js</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script type="module"> | |
| import { pipeline, TextStreamer } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.3'; | |
| window.pipeline = pipeline; | |
| window.TextStreamer = TextStreamer; | |
| </script> | |
| </head> | |
| <body> | |
| <div class="app-container"> | |
| <header class="header"> | |
| <h1 class="title">🤖 Gemma Chatbot</h1> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-badge" aria-label="Built with anycoder"> | |
| Built with <strong>anycoder</strong> | |
| </a> | |
| </header> | |
| <main class="main-content"> | |
| <div class="device-selector"> | |
| <label for="device-select">Device:</label> | |
| <select id="device-select"> | |
| <option value="cpu">CPU (Safe)</option> | |
| <option value="webgpu">GPU (WebGPU - Faster)</option> | |
| </select> | |
| <div id="device-status" class="status-indicator"></div> | |
| </div> | |
| <div id="chat-container" class="chat-container"> | |
| <div class="welcome-message"> | |
| <div class="message assistant-message"> | |
| <div class="message-avatar">🤖</div> | |
| <div class="message-content"> | |
| <p>Hello! I'm powered by <strong>Gemma-3-270M</strong>. Ask me anything!</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="input-container"> | |
| <div class="input-wrapper"> | |
| <textarea | |
| id="message-input" | |
| placeholder="Type your message here..." | |
| rows="1" | |
| aria-label="Type your message" | |
| ></textarea> | |
| <button id="send-button" class="send-button" disabled> | |
| <span class="send-icon">➤</span> | |
| <span class="send-text">Send</span> | |
| </button> | |
| </div> | |
| <div id="loading-indicator" class="loading-indicator" style="display: none;"> | |
| <div class="spinner"></div> | |
| <span>Thinking...</span> | |
| </div> | |
| </div> | |
| </main> | |
| <div id="error-toast" class="toast" role="alert" aria-live="polite"></div> | |
| </div> | |
| <script type="module" src="index.js"></script> | |
| </body> | |
| </html> |