Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +92 -19
index.html
CHANGED
|
@@ -2,28 +2,101 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
|
| 4 |
<head>
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 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>Gemma Chatbot</title>
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<link rel="stylesheet" href="style.css">
|
| 10 |
</head>
|
| 11 |
|
| 12 |
+
<body class="bg-gray-50">
|
| 13 |
+
<div class="flex flex-col h-screen">
|
| 14 |
+
<!-- Header -->
|
| 15 |
+
<header class="bg-white shadow-sm border-b border-gray-200">
|
| 16 |
+
<div class="max-w-4xl mx-auto px-4 py-4">
|
| 17 |
+
<div class="flex items-center justify-between">
|
| 18 |
+
<div class="flex items-center space-x-3">
|
| 19 |
+
<div
|
| 20 |
+
class="w-10 h-10 bg-gradient-to-br from-purple-500 to-pink-500 rounded-lg flex items-center justify-center">
|
| 21 |
+
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| 22 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
| 23 |
+
d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z">
|
| 24 |
+
</path>
|
| 25 |
+
</svg>
|
| 26 |
+
</div>
|
| 27 |
+
<div>
|
| 28 |
+
<h1 class="text-xl font-semibold text-gray-900">Gemma Chatbot</h1>
|
| 29 |
+
<p class="text-sm text-gray-500">Powered by Transformers.js</p>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank"
|
| 33 |
+
class="text-sm text-gray-500 hover:text-gray-700 transition-colors">
|
| 34 |
+
Built with anycoder ↗
|
| 35 |
+
</a>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
</header>
|
| 39 |
+
|
| 40 |
+
<!-- Loading Screen -->
|
| 41 |
+
<div id="loadingScreen" class="flex-1 flex items-center justify-center bg-gray-50">
|
| 42 |
+
<div class="text-center">
|
| 43 |
+
<div class="inline-flex items-center justify-center w-16 h-16 mb-4">
|
| 44 |
+
<div class="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-500"></div>
|
| 45 |
+
</div>
|
| 46 |
+
<h2 class="text-xl font-semibold text-gray-900 mb-2">Loading Model</h2>
|
| 47 |
+
<p class="text-gray-500 mb-4">Downloading Gemma model...</p>
|
| 48 |
+
<div class="w-64 bg-gray-200 rounded-full h-2 mx-auto">
|
| 49 |
+
<div id="progressBar" class="bg-purple-500 h-2 rounded-full transition-all duration-300" style="width: 0%">
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
<p id="progressText" class="text-sm text-gray-500 mt-2">0%</p>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
+
|
| 56 |
+
<!-- Chat Container -->
|
| 57 |
+
<div id="chatContainer" class="flex-1 flex flex-col max-w-4xl w-full mx-auto hidden">
|
| 58 |
+
<!-- Messages Area -->
|
| 59 |
+
<div id="messagesArea" class="flex-1 overflow-y-auto p-4 space-y-4">
|
| 60 |
+
<!-- Welcome Message -->
|
| 61 |
+
<div class="flex items-start space-x-3">
|
| 62 |
+
<div
|
| 63 |
+
class="w-8 h-8 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center flex-shrink-0">
|
| 64 |
+
<svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| 65 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
| 66 |
+
d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z">
|
| 67 |
+
</path>
|
| 68 |
+
</svg>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="bg-white rounded-lg shadow-sm p-4 max-w-md">
|
| 71 |
+
<p class="text-gray-800">Hello! I'm Gemma, your AI assistant. How can I help you today?</p>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<!-- Input Area -->
|
| 77 |
+
<div class="border-t border-gray-200 bg-white p-4">
|
| 78 |
+
<div class="flex space-x-3">
|
| 79 |
+
<textarea
|
| 80 |
+
id="messageInput"
|
| 81 |
+
placeholder="Type your message here..."
|
| 82 |
+
class="flex-1 resize-none rounded-lg border border-gray-300 px-4 py-3 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
|
| 83 |
+
rows="1"
|
| 84 |
+
></textarea>
|
| 85 |
+
<button
|
| 86 |
+
id="sendButton"
|
| 87 |
+
class="px-6 py-3 bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-lg hover:from-purple-600 hover:to-pink-600 transition-all duration-200 flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed"
|
| 88 |
+
>
|
| 89 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
| 90 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path>
|
| 91 |
+
</svg>
|
| 92 |
+
</button>
|
| 93 |
+
</div>
|
| 94 |
+
<p class="text-xs text-gray-500 mt-2">Press Enter to send, Shift+Enter for new line</p>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
|
| 99 |
+
<script src="index.js"></script>
|
| 100 |
</body>
|
| 101 |
|
| 102 |
</html>
|