Add a default dark theme and 3 other to choose - Initial Deployment
Browse files- README.md +7 -5
- index.html +202 -18
- prompts.txt +2 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: llm
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,203 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</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>Local LLM Chat</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@keyframes fadeIn {
|
| 13 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 14 |
+
to { opacity: 1; transform: translateY(0); }
|
| 15 |
+
}
|
| 16 |
+
.message-animation {
|
| 17 |
+
animation: fadeIn 0.3s ease-out forwards;
|
| 18 |
+
}
|
| 19 |
+
.chat-container {
|
| 20 |
+
height: calc(100vh - 160px);
|
| 21 |
+
}
|
| 22 |
+
.typing-indicator::after {
|
| 23 |
+
content: '...';
|
| 24 |
+
animation: typing 1.5s infinite;
|
| 25 |
+
}
|
| 26 |
+
@keyframes typing {
|
| 27 |
+
0% { content: '.'; }
|
| 28 |
+
33% { content: '..'; }
|
| 29 |
+
66% { content: '...'; }
|
| 30 |
+
}
|
| 31 |
+
</style>
|
| 32 |
+
</head>
|
| 33 |
+
<body class="bg-gray-50 text-gray-800 font-sans">
|
| 34 |
+
<div class="max-w-4xl mx-auto h-screen flex flex-col">
|
| 35 |
+
<!-- Header -->
|
| 36 |
+
<header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
|
| 37 |
+
<div class="flex items-center space-x-3">
|
| 38 |
+
<div class="w-10 h-10 rounded-full bg-gradient-to-r from-purple-500 to-blue-500 flex items-center justify-center">
|
| 39 |
+
<i data-feather="cpu" class="text-white"></i>
|
| 40 |
+
</div>
|
| 41 |
+
<h1 class="text-xl font-semibold">Local LLM Chat</h1>
|
| 42 |
+
</div>
|
| 43 |
+
<button class="p-2 rounded-full hover:bg-gray-100 transition-colors">
|
| 44 |
+
<i data-feather="settings" class="text-gray-500"></i>
|
| 45 |
+
</button>
|
| 46 |
+
</header>
|
| 47 |
+
|
| 48 |
+
<!-- Chat Area -->
|
| 49 |
+
<div class="chat-container overflow-y-auto p-6 space-y-4 flex-1">
|
| 50 |
+
<!-- Welcome Message -->
|
| 51 |
+
<div class="flex justify-start" data-aos="fade-right">
|
| 52 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-white rounded-2xl p-4 shadow-sm">
|
| 53 |
+
<div class="flex items-start space-x-2">
|
| 54 |
+
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
|
| 55 |
+
<i data-feather="cpu" class="text-gray-600 w-4 h-4"></i>
|
| 56 |
+
</div>
|
| 57 |
+
<div>
|
| 58 |
+
<p class="text-sm font-medium text-gray-700">Local LLM</p>
|
| 59 |
+
<p class="text-gray-600 mt-1">Hello! I'm your local AI assistant. How can I help you today?</p>
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<!-- Example User Message -->
|
| 66 |
+
<div class="flex justify-end" data-aos="fade-left">
|
| 67 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-blue-500 text-white rounded-2xl p-4 shadow-sm">
|
| 68 |
+
<p>What can you do?</p>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<!-- Example AI Response -->
|
| 73 |
+
<div class="flex justify-start">
|
| 74 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-white rounded-2xl p-4 shadow-sm">
|
| 75 |
+
<div class="flex items-start space-x-2">
|
| 76 |
+
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
|
| 77 |
+
<i data-feather="cpu" class="text-gray-600 w-4 h-4"></i>
|
| 78 |
+
</div>
|
| 79 |
+
<div>
|
| 80 |
+
<p class="text-sm font-medium text-gray-700">Local LLM</p>
|
| 81 |
+
<p class="text-gray-600 mt-1">I can answer questions, help with creative writing, summarize text, and much more - all running locally on your machine for privacy.</p>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<!-- Typing Indicator (hidden by default) -->
|
| 88 |
+
<div id="typing-indicator" class="flex justify-start hidden">
|
| 89 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-white rounded-2xl p-4 shadow-sm">
|
| 90 |
+
<div class="flex items-start space-x-2">
|
| 91 |
+
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
|
| 92 |
+
<i data-feather="cpu" class="text-gray-600 w-4 h-4"></i>
|
| 93 |
+
</div>
|
| 94 |
+
<div>
|
| 95 |
+
<p class="text-sm font-medium text-gray-700">Local LLM</p>
|
| 96 |
+
<p class="text-gray-600 mt-1 typing-indicator">Thinking</p>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<!-- Input Area -->
|
| 104 |
+
<div class="bg-white border-t border-gray-200 p-4">
|
| 105 |
+
<form id="chat-form" class="flex items-center space-x-2">
|
| 106 |
+
<div class="flex-1 relative">
|
| 107 |
+
<input
|
| 108 |
+
id="message-input"
|
| 109 |
+
type="text"
|
| 110 |
+
placeholder="Type your message..."
|
| 111 |
+
class="w-full px-4 py-3 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"
|
| 112 |
+
autocomplete="off"
|
| 113 |
+
>
|
| 114 |
+
<button type="button" class="absolute right-3 top-3 text-gray-400 hover:text-blue-500">
|
| 115 |
+
<i data-feather="paperclip"></i>
|
| 116 |
+
</button>
|
| 117 |
+
</div>
|
| 118 |
+
<button
|
| 119 |
+
type="submit"
|
| 120 |
+
class="w-12 h-12 rounded-full bg-gradient-to-r from-purple-500 to-blue-500 text-white flex items-center justify-center hover:opacity-90 transition-opacity"
|
| 121 |
+
>
|
| 122 |
+
<i data-feather="send"></i>
|
| 123 |
+
</button>
|
| 124 |
+
</form>
|
| 125 |
+
<p class="text-xs text-gray-500 mt-2 text-center">Your conversations stay on your device</p>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<script>
|
| 130 |
+
feather.replace();
|
| 131 |
+
|
| 132 |
+
// Simple chat functionality
|
| 133 |
+
const chatForm = document.getElementById('chat-form');
|
| 134 |
+
const messageInput = document.getElementById('message-input');
|
| 135 |
+
const chatContainer = document.querySelector('.chat-container');
|
| 136 |
+
const typingIndicator = document.getElementById('typing-indicator');
|
| 137 |
+
|
| 138 |
+
chatForm.addEventListener('submit', function(e) {
|
| 139 |
+
e.preventDefault();
|
| 140 |
+
const message = messageInput.value.trim();
|
| 141 |
+
if (!message) return;
|
| 142 |
+
|
| 143 |
+
// Add user message
|
| 144 |
+
addMessage(message, 'user');
|
| 145 |
+
messageInput.value = '';
|
| 146 |
+
|
| 147 |
+
// Show typing indicator
|
| 148 |
+
typingIndicator.classList.remove('hidden');
|
| 149 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 150 |
+
|
| 151 |
+
// Simulate AI response after delay
|
| 152 |
+
setTimeout(() => {
|
| 153 |
+
typingIndicator.classList.add('hidden');
|
| 154 |
+
addMessage(getRandomResponse(), 'ai');
|
| 155 |
+
}, 1500 + Math.random() * 2000);
|
| 156 |
+
});
|
| 157 |
+
|
| 158 |
+
function addMessage(text, sender) {
|
| 159 |
+
const messageDiv = document.createElement('div');
|
| 160 |
+
messageDiv.classList.add('flex', 'message-animation');
|
| 161 |
+
|
| 162 |
+
if (sender === 'user') {
|
| 163 |
+
messageDiv.classList.add('justify-end');
|
| 164 |
+
messageDiv.innerHTML = `
|
| 165 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-blue-500 text-white rounded-2xl p-4 shadow-sm">
|
| 166 |
+
<p>${text}</p>
|
| 167 |
+
</div>
|
| 168 |
+
`;
|
| 169 |
+
} else {
|
| 170 |
+
messageDiv.classList.add('justify-start');
|
| 171 |
+
messageDiv.innerHTML = `
|
| 172 |
+
<div class="max-w-xs md:max-w-md lg:max-w-lg bg-white rounded-2xl p-4 shadow-sm">
|
| 173 |
+
<div class="flex items-start space-x-2">
|
| 174 |
+
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
|
| 175 |
+
<i data-feather="cpu" class="text-gray-600 w-4 h-4"></i>
|
| 176 |
+
</div>
|
| 177 |
+
<div>
|
| 178 |
+
<p class="text-sm font-medium text-gray-700">Local LLM</p>
|
| 179 |
+
<p class="text-gray-600 mt-1">${text}</p>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
`;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
chatContainer.appendChild(messageDiv);
|
| 187 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 188 |
+
feather.replace();
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
function getRandomResponse() {
|
| 192 |
+
const responses = [
|
| 193 |
+
"That's an interesting question. Based on my training data, I would say...",
|
| 194 |
+
"I can help with that. Here's what I know about this topic...",
|
| 195 |
+
"Great question! The answer depends on several factors...",
|
| 196 |
+
"I'm glad you asked. This is a complex topic, but in summary...",
|
| 197 |
+
"Let me think about that for a moment. My analysis suggests..."
|
| 198 |
+
];
|
| 199 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 200 |
+
}
|
| 201 |
+
</script>
|
| 202 |
+
</body>
|
| 203 |
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Create a simple chatbot ui for local LLM's. Make it a modern and elegant looking
|
| 2 |
+
Add a default dark theme and 3 other to choose
|