Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +89 -19
index.html
CHANGED
|
@@ -2,28 +2,98 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
|
| 4 |
<head>
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
<title>Transformers.js - Object Detection</title>
|
| 10 |
</head>
|
| 11 |
|
| 12 |
<body>
|
| 13 |
-
|
| 14 |
-
<
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
</body>
|
| 28 |
|
| 29 |
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>AI Chatbot - Transformers.js</title>
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
|
|
|
| 9 |
</head>
|
| 10 |
|
| 11 |
<body>
|
| 12 |
+
<div class="container">
|
| 13 |
+
<header class="header">
|
| 14 |
+
<div class="header-content">
|
| 15 |
+
<h1>AI Chatbot</h1>
|
| 16 |
+
<p class="subtitle">Powered by Transformers.js</p>
|
| 17 |
+
</div>
|
| 18 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">Built with
|
| 19 |
+
anycoder</a>
|
| 20 |
+
</header>
|
| 21 |
+
|
| 22 |
+
<main class="main-content">
|
| 23 |
+
<div class="settings-panel">
|
| 24 |
+
<div class="setting-group">
|
| 25 |
+
<label for="model-select">Model:</label>
|
| 26 |
+
<select id="model-select">
|
| 27 |
+
<option value="Xenova/distilgpt2">DistilGPT2 (Fast)</option>
|
| 28 |
+
<option value="Xenova/gpt2">GPT2 (Balanced)</option>
|
| 29 |
+
<option value="Xenova/gpt2-medium">GPT2 Medium (Better)</option>
|
| 30 |
+
</select>
|
| 31 |
+
</div>
|
| 32 |
+
<div class="setting-group">
|
| 33 |
+
<label for="device-select">Device:</label>
|
| 34 |
+
<select id="device-select">
|
| 35 |
+
<option value="wasm">CPU (WebAssembly)</option>
|
| 36 |
+
<option value="webgpu">GPU (WebGPU)</option>
|
| 37 |
+
</select>
|
| 38 |
+
</div>
|
| 39 |
+
<button id="clear-chat" class="clear-btn">Clear Chat</button>
|
| 40 |
+
</div>
|
| 41 |
+
|
| 42 |
+
<div class="chat-container">
|
| 43 |
+
<div id="messages" class="messages">
|
| 44 |
+
<div class="message bot-message">
|
| 45 |
+
<div class="message-content">
|
| 46 |
+
<p>Hello! I'm your AI assistant. How can I help you today?</p>
|
| 47 |
+
</div>
|
| 48 |
+
<div class="message-time">Bot</div>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
<div id="typing-indicator" class="typing-indicator hidden">
|
| 52 |
+
<span></span>
|
| 53 |
+
<span></span>
|
| 54 |
+
<span></span>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
<div class="input-container">
|
| 59 |
+
<div class="input-wrapper">
|
| 60 |
+
<textarea
|
| 61 |
+
id="message-input"
|
| 62 |
+
placeholder="Type your message here..."
|
| 63 |
+
rows="1"
|
| 64 |
+
maxlength="500"
|
| 65 |
+
></textarea>
|
| 66 |
+
<button id="send-button" class="send-button" disabled>
|
| 67 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 68 |
+
<line x1="22" y1="2" x2="11" y2="13"></line>
|
| 69 |
+
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
| 70 |
+
</svg>
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
<div class="input-info">
|
| 74 |
+
<span id="char-count">0 / 500</span>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</main>
|
| 78 |
+
|
| 79 |
+
<div id="loading-overlay" class="loading-overlay hidden">
|
| 80 |
+
<div class="loading-content">
|
| 81 |
+
<div class="spinner"></div>
|
| 82 |
+
<p>Loading model...</p>
|
| 83 |
+
<p class="loading-subtitle">This may take a few moments</p>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<div id="error-toast" class="error-toast hidden">
|
| 88 |
+
<div class="error-content">
|
| 89 |
+
<span class="error-icon">!</span>
|
| 90 |
+
<span id="error-message">An error occurred</span>
|
| 91 |
+
<button id="dismiss-error" class="dismiss-btn">×</button>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<script type="module" src="index.js"></script>
|
| 97 |
</body>
|
| 98 |
|
| 99 |
</html>
|