Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +102 -21
index.html
CHANGED
|
@@ -1,29 +1,110 @@
|
|
| 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 |
-
|
| 27 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
|
|
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Gemma AI Chatbot</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
| 10 |
</head>
|
|
|
|
| 11 |
<body>
|
| 12 |
+
<div class="app-container">
|
| 13 |
+
<!-- Header -->
|
| 14 |
+
<header class="header">
|
| 15 |
+
<div class="header-content">
|
| 16 |
+
<div class="logo">
|
| 17 |
+
<i class="fas fa-robot"></i>
|
| 18 |
+
<h1>Gemma AI Chatbot</h1>
|
| 19 |
+
</div>
|
| 20 |
+
<div class="device-toggle">
|
| 21 |
+
<span class="device-label">Execution:</span>
|
| 22 |
+
<button id="deviceToggle" class="device-btn">
|
| 23 |
+
<span class="device-option active" data-device="cpu">CPU</span>
|
| 24 |
+
<span class="device-option" data-device="webgpu">GPU</span>
|
| 25 |
+
</button>
|
| 26 |
+
<div class="status-indicator">
|
| 27 |
+
<i class="fas fa-circle"></i>
|
| 28 |
+
<span id="statusText">Loading...</span>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
<div class="credit">
|
| 33 |
+
Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" rel="noopener noreferrer">anycoder</a>
|
| 34 |
+
</div>
|
| 35 |
+
</header>
|
| 36 |
|
| 37 |
+
<!-- Main Chat Area -->
|
| 38 |
+
<main class="main-content">
|
| 39 |
+
<div class="chat-container">
|
| 40 |
+
<div class="messages-container" id="messagesContainer">
|
| 41 |
+
<div class="welcome-message">
|
| 42 |
+
<div class="welcome-icon">
|
| 43 |
+
<i class="fas fa-comments"></i>
|
| 44 |
+
</div>
|
| 45 |
+
<h2>Welcome to Gemma AI Chatbot</h2>
|
| 46 |
+
<p>Start a conversation with the AI assistant. I'm here to help with any questions you have!</p>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<!-- Input Area -->
|
| 51 |
+
<div class="input-container">
|
| 52 |
+
<div class="input-wrapper">
|
| 53 |
+
<textarea
|
| 54 |
+
id="messageInput"
|
| 55 |
+
placeholder="Type your message here..."
|
| 56 |
+
rows="1"
|
| 57 |
+
disabled
|
| 58 |
+
></textarea>
|
| 59 |
+
<button id="sendButton" class="send-button" disabled>
|
| 60 |
+
<i class="fas fa-paper-plane"></i>
|
| 61 |
+
</button>
|
| 62 |
+
</div>
|
| 63 |
+
<div class="input-footer">
|
| 64 |
+
<span class="model-info">
|
| 65 |
+
<i class="fas fa-microchip"></i>
|
| 66 |
+
Model: gemma-3-270m-it-ONNX
|
| 67 |
+
</span>
|
| 68 |
+
<span class="char-count">
|
| 69 |
+
<span id="charCount">0</span>/1000
|
| 70 |
+
</span>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</main>
|
| 75 |
|
| 76 |
+
<!-- Loading Overlay -->
|
| 77 |
+
<div class="loading-overlay" id="loadingOverlay">
|
| 78 |
+
<div class="loading-content">
|
| 79 |
+
<div class="loading-spinner">
|
| 80 |
+
<div class="spinner"></div>
|
| 81 |
+
</div>
|
| 82 |
+
<h3>Initializing AI Model</h3>
|
| 83 |
+
<p>Please wait while we load the Gemma AI model...</p>
|
| 84 |
+
<div class="progress-bar">
|
| 85 |
+
<div class="progress-fill" id="progressFill"></div>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
|
| 90 |
+
<!-- Error Modal -->
|
| 91 |
+
<div class="error-modal" id="errorModal">
|
| 92 |
+
<div class="error-content">
|
| 93 |
+
<div class="error-icon">
|
| 94 |
+
<i class="fas fa-exclamation-triangle"></i>
|
| 95 |
+
</div>
|
| 96 |
+
<h3>Error</h3>
|
| 97 |
+
<p id="errorMessage">An error occurred while initializing the AI model.</p>
|
| 98 |
+
<button class="retry-button" id="retryButton">Retry</button>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<!-- Transformers.js Import -->
|
| 104 |
+
<script type="module">
|
| 105 |
+
import { pipeline, TextStreamer } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.3';
|
| 106 |
+
window.transformers = { pipeline, TextStreamer };
|
| 107 |
+
</script>
|
| 108 |
+
<script src="index.js"></script>
|
| 109 |
+
</body>
|
| 110 |
</html>
|