anycoder-24c18dca / index.html
akhaliq's picture
akhaliq HF Staff
Upload index.html with huggingface_hub
44c25b8 verified
<!DOCTYPE html>
<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.transformers = { pipeline, TextStreamer };
</script>
</head>
<body>
<div class="app-container">
<header class="header">
<h1>🤖 Gemma Chatbot</h1>
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link" aria-label="Built with anycoder">Built with anycoder</a>
<div class="device-selector">
<label for="device-select">Device:</label>
<select id="device-select">
<option value="cpu">CPU</option>
<option value="webgpu">GPU (WebGPU)</option>
</select>
</div>
</header>
<main class="main-content">
<div id="chat-container" class="chat-container">
<div class="message system-message">
<div class="message-content">
<strong>Gemma:</strong> Hello! I'm Gemma, a helpful AI assistant powered by transformers.js. How can I help you today?
</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" aria-label="Send message">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
</svg>
</button>
</div>
<div id="loading-indicator" class="loading-indicator hidden">
<div class="spinner"></div>
<span>Thinking...</span>
</div>
</div>
</main>
<div id="error-toast" class="error-toast hidden">
<span id="error-message"></span>
</div>
</div>
<script type="module" src="index.js"></script>
</body>
</html>