Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +74 -20
index.html
CHANGED
|
@@ -1,29 +1,83 @@
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
-
|
| 4 |
<head>
|
| 5 |
-
<meta charset="UTF-8"
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
<
|
| 9 |
-
<
|
| 10 |
</head>
|
| 11 |
-
|
| 12 |
<body>
|
| 13 |
-
<
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
<
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
<script src="index.js" type="module"></script>
|
| 27 |
</body>
|
| 28 |
-
|
| 29 |
</html>
|
|
|
|
| 1 |
+
<!-- index.html content here -->
|
| 2 |
<!DOCTYPE html>
|
| 3 |
<html lang="en">
|
|
|
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>AI Chat Assistant</title>
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 10 |
</head>
|
|
|
|
| 11 |
<body>
|
| 12 |
+
<div class="app-container">
|
| 13 |
+
<header class="header">
|
| 14 |
+
<h1><i class="fas fa-robot"></i> AI Chat Assistant</h1>
|
| 15 |
+
<div class="device-selector">
|
| 16 |
+
<label for="device-select">Execution Device:</label>
|
| 17 |
+
<select id="device-select">
|
| 18 |
+
<option value="cpu">CPU (WASM)</option>
|
| 19 |
+
<option value="webgpu">GPU (WebGPU) - Experimental</option>
|
| 20 |
+
</select>
|
| 21 |
+
<button id="device-toggle" class="btn-secondary">
|
| 22 |
+
<i class="fas fa-microchip"></i> CPU
|
| 23 |
+
</button>
|
| 24 |
+
</div>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<main class="chat-container">
|
| 28 |
+
<div class="messages-container" id="messages-container" role="log" aria-live="polite">
|
| 29 |
+
<div class="welcome-message">
|
| 30 |
+
<div class="message assistant-message">
|
| 31 |
+
<div class="message-header">
|
| 32 |
+
<i class="fas fa-robot"></i>
|
| 33 |
+
<span class="message-author">AI Assistant</span>
|
| 34 |
+
<span class="message-time"></span>
|
| 35 |
+
</div>
|
| 36 |
+
<div class="message-content">
|
| 37 |
+
Hello! I'm your AI assistant powered by MobileLLM. How can I help you today? I can solve math problems, answer questions, and much more!
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<div class="input-container">
|
| 44 |
+
<div class="input-wrapper">
|
| 45 |
+
<textarea
|
| 46 |
+
id="message-input"
|
| 47 |
+
placeholder="Type your message here... (e.g., Solve x^2 - x - 6 = 0)"
|
| 48 |
+
rows="1"
|
| 49 |
+
aria-label="Type your message"
|
| 50 |
+
></textarea>
|
| 51 |
+
<button id="send-button" class="send-button" aria-label="Send message">
|
| 52 |
+
<i class="fas fa-paper-plane"></i>
|
| 53 |
+
</button>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="input-footer">
|
| 56 |
+
<small>Press Enter to send, Shift+Enter for new line</small>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</main>
|
| 60 |
+
|
| 61 |
+
<div class="loading-overlay" id="loading-overlay">
|
| 62 |
+
<div class="loading-spinner">
|
| 63 |
+
<i class="fas fa-spinner fa-spin"></i>
|
| 64 |
+
<p>AI is thinking...</p>
|
| 65 |
+
</div>
|
| 66 |
+
</div>
|
| 67 |
+
|
| 68 |
+
<div class="status-bar" id="status-bar">
|
| 69 |
+
<span id="status-text">Ready to chat</span>
|
| 70 |
+
<span id="model-status">Model: Loading...</span>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<!-- Transformers.js Import -->
|
| 75 |
+
<script type="module">
|
| 76 |
+
import { pipeline, TextStreamer } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.3';
|
| 77 |
+
window.pipeline = pipeline;
|
| 78 |
+
window.TextStreamer = TextStreamer;
|
| 79 |
+
</script>
|
| 80 |
|
| 81 |
<script src="index.js" type="module"></script>
|
| 82 |
</body>
|
|
|
|
| 83 |
</html>
|