Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +552 -19
- prompts.txt +0 -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: server
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: pink
|
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,552 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en" class="dark">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>DARK_MAX AI SERVER</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<script>
|
10 |
+
tailwind.config = {
|
11 |
+
darkMode: 'class',
|
12 |
+
theme: {
|
13 |
+
extend: {
|
14 |
+
colors: {
|
15 |
+
dark: {
|
16 |
+
900: '#0a0a0a',
|
17 |
+
800: '#1a1a1a',
|
18 |
+
700: '#2a2a2a',
|
19 |
+
600: '#3a3a3a',
|
20 |
+
},
|
21 |
+
primary: {
|
22 |
+
500: '#6d28d9',
|
23 |
+
600: '#5b21b6',
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
</script>
|
30 |
+
<style>
|
31 |
+
.code-block {
|
32 |
+
font-family: 'Courier New', monospace;
|
33 |
+
background-color: rgba(0, 0, 0, 0.3);
|
34 |
+
border-left: 3px solid #6d28d9;
|
35 |
+
}
|
36 |
+
.glow {
|
37 |
+
text-shadow: 0 0 8px rgba(109, 40, 217, 0.7);
|
38 |
+
}
|
39 |
+
.pulse {
|
40 |
+
animation: pulse 2s infinite;
|
41 |
+
}
|
42 |
+
@keyframes pulse {
|
43 |
+
0% { opacity: 0.7; }
|
44 |
+
50% { opacity: 1; }
|
45 |
+
100% { opacity: 0.7; }
|
46 |
+
}
|
47 |
+
.terminal {
|
48 |
+
background-color: rgba(0, 0, 0, 0.5);
|
49 |
+
border: 1px solid #333;
|
50 |
+
border-radius: 0.5rem;
|
51 |
+
font-family: 'Courier New', monospace;
|
52 |
+
}
|
53 |
+
.file-drop-area {
|
54 |
+
border: 2px dashed #6d28d9;
|
55 |
+
transition: all 0.3s;
|
56 |
+
}
|
57 |
+
.file-drop-area.active {
|
58 |
+
border-color: #fff;
|
59 |
+
background-color: rgba(109, 40, 217, 0.1);
|
60 |
+
}
|
61 |
+
</style>
|
62 |
+
</head>
|
63 |
+
<body class="bg-dark-900 text-gray-200 min-h-screen">
|
64 |
+
<div class="container mx-auto px-4 py-8">
|
65 |
+
<!-- Header -->
|
66 |
+
<header class="flex justify-between items-center mb-8 border-b border-dark-700 pb-4">
|
67 |
+
<div class="flex items-center space-x-3">
|
68 |
+
<div class="w-10 h-10 bg-primary-500 rounded-full flex items-center justify-center">
|
69 |
+
<i class="fas fa-brain text-xl"></i>
|
70 |
+
</div>
|
71 |
+
<h1 class="text-2xl font-bold glow">DARK_MAX <span class="text-primary-500">AI SERVER</span></h1>
|
72 |
+
</div>
|
73 |
+
<div class="flex items-center space-x-4">
|
74 |
+
<button id="themeToggle" class="p-2 rounded-full hover:bg-dark-700 transition">
|
75 |
+
<i class="fas fa-moon"></i>
|
76 |
+
</button>
|
77 |
+
<div class="flex items-center space-x-2">
|
78 |
+
<span class="h-3 w-3 bg-green-500 rounded-full pulse"></span>
|
79 |
+
<span class="text-sm">Operational</span>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</header>
|
83 |
+
|
84 |
+
<!-- Main Grid -->
|
85 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
86 |
+
<!-- Left Panel - Upload & Files -->
|
87 |
+
<div class="lg:col-span-1 space-y-6">
|
88 |
+
<!-- Upload Section -->
|
89 |
+
<div class="bg-dark-800 rounded-lg p-6 shadow-lg">
|
90 |
+
<h2 class="text-xl font-semibold mb-4 flex items-center">
|
91 |
+
<i class="fas fa-cloud-upload-alt mr-2 text-primary-500"></i>
|
92 |
+
Upload Source Files
|
93 |
+
</h2>
|
94 |
+
<div id="fileDropArea" class="file-drop-area rounded-lg p-8 text-center cursor-pointer mb-4">
|
95 |
+
<i class="fas fa-file-upload text-4xl mb-3 text-primary-500"></i>
|
96 |
+
<p class="mb-2">Drag & drop files here</p>
|
97 |
+
<p class="text-sm text-gray-400 mb-4">or</p>
|
98 |
+
<input type="file" id="fileInput" class="hidden" multiple accept=".py,.sh,.ps1,.md,.txt,.c,.cpp,.js,.html,.css,.java,.go,.rs">
|
99 |
+
<label for="fileInput" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded cursor-pointer transition">
|
100 |
+
Select Files
|
101 |
+
</label>
|
102 |
+
</div>
|
103 |
+
<div id="fileList" class="max-h-60 overflow-y-auto">
|
104 |
+
<!-- Files will be listed here -->
|
105 |
+
</div>
|
106 |
+
<button id="uploadBtn" class="w-full mt-4 bg-primary-500 hover:bg-primary-600 text-white py-2 rounded flex items-center justify-center transition">
|
107 |
+
<i class="fas fa-server mr-2"></i> Process & Index Files
|
108 |
+
</button>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<!-- Database Info -->
|
112 |
+
<div class="bg-dark-800 rounded-lg p-6 shadow-lg">
|
113 |
+
<h2 class="text-xl font-semibold mb-4 flex items-center">
|
114 |
+
<i class="fas fa-database mr-2 text-primary-500"></i>
|
115 |
+
Vector Database
|
116 |
+
</h2>
|
117 |
+
<div class="space-y-3">
|
118 |
+
<div class="flex justify-between">
|
119 |
+
<span>Documents:</span>
|
120 |
+
<span id="docCount" class="font-mono">0</span>
|
121 |
+
</div>
|
122 |
+
<div class="flex justify-between">
|
123 |
+
<span>Chunks:</span>
|
124 |
+
<span id="chunkCount" class="font-mono">0</span>
|
125 |
+
</div>
|
126 |
+
<div class="flex justify-between">
|
127 |
+
<span>Embedding Model:</span>
|
128 |
+
<span class="font-mono">all-MiniLM-L6-v2</span>
|
129 |
+
</div>
|
130 |
+
<div class="flex justify-between">
|
131 |
+
<span>Storage:</span>
|
132 |
+
<span class="font-mono">ChromaDB</span>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
<button id="refreshDbBtn" class="w-full mt-4 bg-dark-700 hover:bg-dark-600 text-white py-2 rounded flex items-center justify-center transition">
|
136 |
+
<i class="fas fa-sync-alt mr-2"></i> Refresh Stats
|
137 |
+
</button>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
|
141 |
+
<!-- Center Panel - Query & Results -->
|
142 |
+
<div class="lg:col-span-2 space-y-6">
|
143 |
+
<!-- Query Section -->
|
144 |
+
<div class="bg-dark-800 rounded-lg p-6 shadow-lg">
|
145 |
+
<h2 class="text-xl font-semibold mb-4 flex items-center">
|
146 |
+
<i class="fas fa-terminal mr-2 text-primary-500"></i>
|
147 |
+
Semantic Query
|
148 |
+
</h2>
|
149 |
+
<div class="flex space-x-2 mb-4">
|
150 |
+
<button class="bg-dark-700 hover:bg-dark-600 px-3 py-1 rounded text-sm">Code</button>
|
151 |
+
<button class="bg-dark-700 hover:bg-dark-600 px-3 py-1 rounded text-sm">Documentation</button>
|
152 |
+
<button class="bg-dark-700 hover:bg-dark-600 px-3 py-1 rounded text-sm">Examples</button>
|
153 |
+
</div>
|
154 |
+
<div class="relative">
|
155 |
+
<textarea id="queryInput" rows="4" class="w-full bg-dark-700 border border-dark-600 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-primary-500" placeholder="Enter your query about the indexed files..."></textarea>
|
156 |
+
<div class="absolute bottom-3 right-3 flex space-x-2">
|
157 |
+
<button id="clearQueryBtn" class="p-1 text-gray-400 hover:text-white">
|
158 |
+
<i class="fas fa-times"></i>
|
159 |
+
</button>
|
160 |
+
<button id="sendQueryBtn" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-1 rounded flex items-center transition">
|
161 |
+
<i class="fas fa-paper-plane mr-2"></i> Send
|
162 |
+
</button>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
<!-- Results Section -->
|
168 |
+
<div class="bg-dark-800 rounded-lg p-6 shadow-lg">
|
169 |
+
<div class="flex justify-between items-center mb-4">
|
170 |
+
<h2 class="text-xl font-semibold flex items-center">
|
171 |
+
<i class="fas fa-search mr-2 text-primary-500"></i>
|
172 |
+
Query Results
|
173 |
+
</h2>
|
174 |
+
<div class="flex space-x-2">
|
175 |
+
<button id="exportJsonBtn" class="bg-dark-700 hover:bg-dark-600 px-3 py-1 rounded text-sm flex items-center">
|
176 |
+
<i class="fas fa-file-export mr-1"></i> Export JSON
|
177 |
+
</button>
|
178 |
+
<button id="generateDatasetBtn" class="bg-primary-500 hover:bg-primary-600 px-3 py-1 rounded text-sm flex items-center">
|
179 |
+
<i class="fas fa-database mr-1"></i> Generate Dataset
|
180 |
+
</button>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
<div id="resultsContainer" class="space-y-4">
|
184 |
+
<div class="terminal p-4 text-gray-300">
|
185 |
+
<div class="flex items-center mb-2">
|
186 |
+
<span class="text-green-500 mr-2">$</span>
|
187 |
+
<span class="text-gray-400">Ready to process queries...</span>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
|
193 |
+
<!-- Training Section (Collapsible) -->
|
194 |
+
<div class="bg-dark-800 rounded-lg shadow-lg overflow-hidden">
|
195 |
+
<div class="flex justify-between items-center p-6 cursor-pointer" id="trainingHeader">
|
196 |
+
<h2 class="text-xl font-semibold flex items-center">
|
197 |
+
<i class="fas fa-robot mr-2 text-primary-500"></i>
|
198 |
+
Model Training
|
199 |
+
</h2>
|
200 |
+
<i class="fas fa-chevron-down transition-transform" id="trainingArrow"></i>
|
201 |
+
</div>
|
202 |
+
<div class="px-6 pb-6 hidden" id="trainingContent">
|
203 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
204 |
+
<div>
|
205 |
+
<label class="block text-sm font-medium mb-1">Training Method</label>
|
206 |
+
<select class="w-full bg-dark-700 border border-dark-600 rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary-500">
|
207 |
+
<option>QLoRA</option>
|
208 |
+
<option>PEFT</option>
|
209 |
+
<option>Full Fine-Tuning</option>
|
210 |
+
</select>
|
211 |
+
</div>
|
212 |
+
<div>
|
213 |
+
<label class="block text-sm font-medium mb-1">Base Model</label>
|
214 |
+
<select class="w-full bg-dark-700 border border-dark-600 rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary-500">
|
215 |
+
<option>DeepSeek-Coder</option>
|
216 |
+
<option>GPT4All</option>
|
217 |
+
<option>Llama 2</option>
|
218 |
+
<option>Mistral</option>
|
219 |
+
</select>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
<div class="mb-4">
|
223 |
+
<label class="block text-sm font-medium mb-1">Training Parameters</label>
|
224 |
+
<div class="grid grid-cols-3 gap-2">
|
225 |
+
<div>
|
226 |
+
<label class="text-xs block mb-1">Epochs</label>
|
227 |
+
<input type="number" value="3" class="w-full bg-dark-700 border border-dark-600 rounded-lg p-2">
|
228 |
+
</div>
|
229 |
+
<div>
|
230 |
+
<label class="text-xs block mb-1">Batch Size</label>
|
231 |
+
<input type="number" value="4" class="w-full bg-dark-700 border border-dark-600 rounded-lg p-2">
|
232 |
+
</div>
|
233 |
+
<div>
|
234 |
+
<label class="text-xs block mb-1">LR</label>
|
235 |
+
<input type="text" value="2e-5" class="w-full bg-dark-700 border border-dark-600 rounded-lg p-2">
|
236 |
+
</div>
|
237 |
+
</div>
|
238 |
+
</div>
|
239 |
+
<div class="flex justify-between">
|
240 |
+
<button class="bg-dark-700 hover:bg-dark-600 px-4 py-2 rounded flex items-center">
|
241 |
+
<i class="fas fa-cog mr-2"></i> Advanced
|
242 |
+
</button>
|
243 |
+
<button class="bg-primary-500 hover:bg-primary-600 px-4 py-2 rounded flex items-center">
|
244 |
+
<i class="fas fa-play mr-2"></i> Start Training
|
245 |
+
</button>
|
246 |
+
</div>
|
247 |
+
</div>
|
248 |
+
</div>
|
249 |
+
</div>
|
250 |
+
</div>
|
251 |
+
|
252 |
+
<!-- Status Bar -->
|
253 |
+
<div class="mt-8 bg-dark-800 rounded-lg p-3 text-sm flex justify-between items-center">
|
254 |
+
<div class="flex items-center space-x-4">
|
255 |
+
<div class="flex items-center space-x-1">
|
256 |
+
<i class="fas fa-microchip text-primary-500"></i>
|
257 |
+
<span>LLM: <span id="currentModel">DeepSeek-Coder-6.7B</span></span>
|
258 |
+
</div>
|
259 |
+
<div class="flex items-center space-x-1">
|
260 |
+
<i class="fas fa-memory text-primary-500"></i>
|
261 |
+
<span>VRAM: <span id="vramUsage">12.4/16 GB</span></span>
|
262 |
+
</div>
|
263 |
+
</div>
|
264 |
+
<div class="text-gray-400">
|
265 |
+
<span id="serverStatus">Server: 127.0.0.1:5000</span>
|
266 |
+
<span class="mx-2">|</span>
|
267 |
+
<span id="lastUpdate">Last indexed: Never</span>
|
268 |
+
</div>
|
269 |
+
</div>
|
270 |
+
</div>
|
271 |
+
|
272 |
+
<script>
|
273 |
+
// DOM Elements
|
274 |
+
const themeToggle = document.getElementById('themeToggle');
|
275 |
+
const fileDropArea = document.getElementById('fileDropArea');
|
276 |
+
const fileInput = document.getElementById('fileInput');
|
277 |
+
const fileList = document.getElementById('fileList');
|
278 |
+
const uploadBtn = document.getElementById('uploadBtn');
|
279 |
+
const queryInput = document.getElementById('queryInput');
|
280 |
+
const clearQueryBtn = document.getElementById('clearQueryBtn');
|
281 |
+
const sendQueryBtn = document.getElementById('sendQueryBtn');
|
282 |
+
const resultsContainer = document.getElementById('resultsContainer');
|
283 |
+
const exportJsonBtn = document.getElementById('exportJsonBtn');
|
284 |
+
const generateDatasetBtn = document.getElementById('generateDatasetBtn');
|
285 |
+
const refreshDbBtn = document.getElementById('refreshDbBtn');
|
286 |
+
const docCount = document.getElementById('docCount');
|
287 |
+
const chunkCount = document.getElementById('chunkCount');
|
288 |
+
const trainingHeader = document.getElementById('trainingHeader');
|
289 |
+
const trainingContent = document.getElementById('trainingContent');
|
290 |
+
const trainingArrow = document.getElementById('trainingArrow');
|
291 |
+
const currentModel = document.getElementById('currentModel');
|
292 |
+
const vramUsage = document.getElementById('vramUsage');
|
293 |
+
const lastUpdate = document.getElementById('lastUpdate');
|
294 |
+
|
295 |
+
// Theme Toggle
|
296 |
+
themeToggle.addEventListener('click', () => {
|
297 |
+
document.documentElement.classList.toggle('dark');
|
298 |
+
const icon = themeToggle.querySelector('i');
|
299 |
+
if (document.documentElement.classList.contains('dark')) {
|
300 |
+
icon.classList.remove('fa-sun');
|
301 |
+
icon.classList.add('fa-moon');
|
302 |
+
} else {
|
303 |
+
icon.classList.remove('fa-moon');
|
304 |
+
icon.classList.add('fa-sun');
|
305 |
+
}
|
306 |
+
});
|
307 |
+
|
308 |
+
// File Drop Area
|
309 |
+
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
310 |
+
fileDropArea.addEventListener(eventName, preventDefaults, false);
|
311 |
+
});
|
312 |
+
|
313 |
+
function preventDefaults(e) {
|
314 |
+
e.preventDefault();
|
315 |
+
e.stopPropagation();
|
316 |
+
}
|
317 |
+
|
318 |
+
['dragenter', 'dragover'].forEach(eventName => {
|
319 |
+
fileDropArea.addEventListener(eventName, highlight, false);
|
320 |
+
});
|
321 |
+
|
322 |
+
['dragleave', 'drop'].forEach(eventName => {
|
323 |
+
fileDropArea.addEventListener(eventName, unhighlight, false);
|
324 |
+
});
|
325 |
+
|
326 |
+
function highlight() {
|
327 |
+
fileDropArea.classList.add('active');
|
328 |
+
}
|
329 |
+
|
330 |
+
function unhighlight() {
|
331 |
+
fileDropArea.classList.remove('active');
|
332 |
+
}
|
333 |
+
|
334 |
+
fileDropArea.addEventListener('drop', handleDrop, false);
|
335 |
+
|
336 |
+
function handleDrop(e) {
|
337 |
+
const dt = e.dataTransfer;
|
338 |
+
const files = dt.files;
|
339 |
+
handleFiles(files);
|
340 |
+
}
|
341 |
+
|
342 |
+
fileInput.addEventListener('change', function() {
|
343 |
+
handleFiles(this.files);
|
344 |
+
});
|
345 |
+
|
346 |
+
// Handle selected files
|
347 |
+
function handleFiles(files) {
|
348 |
+
fileList.innerHTML = '';
|
349 |
+
for (let i = 0; i < files.length; i++) {
|
350 |
+
const file = files[i];
|
351 |
+
const fileItem = document.createElement('div');
|
352 |
+
fileItem.className = 'flex justify-between items-center p-2 bg-dark-700 rounded mb-2';
|
353 |
+
fileItem.innerHTML = `
|
354 |
+
<div class="flex items-center">
|
355 |
+
<i class="fas fa-file-code mr-2 text-primary-500"></i>
|
356 |
+
<span>${file.name}</span>
|
357 |
+
<span class="text-xs text-gray-400 ml-2">(${(file.size / 1024).toFixed(1)} KB)</span>
|
358 |
+
</div>
|
359 |
+
<button class="text-red-400 hover:text-red-300" data-index="${i}">
|
360 |
+
<i class="fas fa-times"></i>
|
361 |
+
</button>
|
362 |
+
`;
|
363 |
+
fileList.appendChild(fileItem);
|
364 |
+
}
|
365 |
+
|
366 |
+
// Add event listeners to remove buttons
|
367 |
+
document.querySelectorAll('#fileList button').forEach(btn => {
|
368 |
+
btn.addEventListener('click', function() {
|
369 |
+
// In a real app, we would remove the file from the FileList
|
370 |
+
// For this demo, we'll just remove the UI element
|
371 |
+
this.parentElement.remove();
|
372 |
+
});
|
373 |
+
});
|
374 |
+
}
|
375 |
+
|
376 |
+
// Upload button
|
377 |
+
uploadBtn.addEventListener('click', function() {
|
378 |
+
if (fileList.children.length === 0) {
|
379 |
+
showMessage('Please select files first', 'error');
|
380 |
+
return;
|
381 |
+
}
|
382 |
+
|
383 |
+
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Processing...';
|
384 |
+
this.disabled = true;
|
385 |
+
|
386 |
+
// Simulate processing
|
387 |
+
setTimeout(() => {
|
388 |
+
this.innerHTML = '<i class="fas fa-check mr-2"></i> Files Processed';
|
389 |
+
showMessage('Files successfully indexed in vector database', 'success');
|
390 |
+
|
391 |
+
// Update stats
|
392 |
+
docCount.textContent = Math.floor(Math.random() * 10) + 5;
|
393 |
+
chunkCount.textContent = Math.floor(Math.random() * 100) + 50;
|
394 |
+
lastUpdate.textContent = `Last indexed: ${new Date().toLocaleString()}`;
|
395 |
+
|
396 |
+
// Reset button after delay
|
397 |
+
setTimeout(() => {
|
398 |
+
this.innerHTML = '<i class="fas fa-server mr-2"></i> Process & Index Files';
|
399 |
+
this.disabled = false;
|
400 |
+
}, 2000);
|
401 |
+
}, 3000);
|
402 |
+
});
|
403 |
+
|
404 |
+
// Query handling
|
405 |
+
clearQueryBtn.addEventListener('click', function() {
|
406 |
+
queryInput.value = '';
|
407 |
+
});
|
408 |
+
|
409 |
+
sendQueryBtn.addEventListener('click', function() {
|
410 |
+
const query = queryInput.value.trim();
|
411 |
+
if (!query) {
|
412 |
+
showMessage('Please enter a query', 'error');
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Processing...';
|
417 |
+
this.disabled = true;
|
418 |
+
|
419 |
+
// Simulate query processing
|
420 |
+
setTimeout(() => {
|
421 |
+
displayQueryResult(query);
|
422 |
+
this.innerHTML = '<i class="fas fa-paper-plane mr-2"></i> Send';
|
423 |
+
this.disabled = false;
|
424 |
+
}, 1500);
|
425 |
+
});
|
426 |
+
|
427 |
+
// Display query result
|
428 |
+
function displayQueryResult(query) {
|
429 |
+
const resultId = Date.now();
|
430 |
+
const codeExamples = [
|
431 |
+
`def hello_world():\n print("Hello, World!")`,
|
432 |
+
`function calculateSum(a, b) {\n return a + b;\n}`,
|
433 |
+
`public class Main {\n public static void main(String[] args) {\n System.out.println("Hello World");\n }\n}`
|
434 |
+
];
|
435 |
+
|
436 |
+
const randomCode = codeExamples[Math.floor(Math.random() * codeExamples.length)];
|
437 |
+
const randomScore = (Math.random() * 0.5 + 0.5).toFixed(2);
|
438 |
+
|
439 |
+
const resultDiv = document.createElement('div');
|
440 |
+
resultDiv.className = 'terminal p-4';
|
441 |
+
resultDiv.innerHTML = `
|
442 |
+
<div class="flex items-center mb-2">
|
443 |
+
<span class="text-green-500 mr-2">$</span>
|
444 |
+
<span class="text-gray-400">${query}</span>
|
445 |
+
</div>
|
446 |
+
<div class="mb-3">
|
447 |
+
<span class="text-xs bg-dark-700 px-2 py-1 rounded">Relevance: ${randomScore}</span>
|
448 |
+
<span class="text-xs bg-dark-700 px-2 py-1 rounded ml-2">Source: example.py</span>
|
449 |
+
</div>
|
450 |
+
<div class="code-block p-3 rounded mb-3">
|
451 |
+
<pre class="whitespace-pre-wrap">${randomCode}</pre>
|
452 |
+
</div>
|
453 |
+
<div class="text-sm">
|
454 |
+
<p>This code demonstrates a basic ${query.includes('function') ? 'function' : 'program'} in ${randomCode.includes('def') ? 'Python' : randomCode.includes('function') ? 'JavaScript' : 'Java'}.</p>
|
455 |
+
<p class="mt-1">It was found in the indexed files with high semantic relevance to your query.</p>
|
456 |
+
</div>
|
457 |
+
<div class="flex justify-end mt-2 space-x-2">
|
458 |
+
<button class="text-xs bg-dark-700 hover:bg-dark-600 px-2 py-1 rounded">Copy</button>
|
459 |
+
<button class="text-xs bg-dark-700 hover:bg-dark-600 px-2 py-1 rounded">View Source</button>
|
460 |
+
<button class="text-xs bg-primary-500 hover:bg-primary-600 px-2 py-1 rounded">Add to Dataset</button>
|
461 |
+
</div>
|
462 |
+
`;
|
463 |
+
|
464 |
+
resultsContainer.prepend(resultDiv);
|
465 |
+
}
|
466 |
+
|
467 |
+
// Export JSON
|
468 |
+
exportJsonBtn.addEventListener('click', function() {
|
469 |
+
showMessage('Dataset exported as fine_tuning_data.json', 'success');
|
470 |
+
});
|
471 |
+
|
472 |
+
// Generate Dataset
|
473 |
+
generateDatasetBtn.addEventListener('click', function() {
|
474 |
+
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
|
475 |
+
this.disabled = true;
|
476 |
+
|
477 |
+
// Simulate dataset generation
|
478 |
+
setTimeout(() => {
|
479 |
+
showMessage('Dataset generated with 42 examples', 'success');
|
480 |
+
this.innerHTML = '<i class="fas fa-database mr-1"></i> Generate Dataset';
|
481 |
+
this.disabled = false;
|
482 |
+
|
483 |
+
// Add a dataset result
|
484 |
+
const resultDiv = document.createElement('div');
|
485 |
+
resultDiv.className = 'terminal p-4';
|
486 |
+
resultDiv.innerHTML = `
|
487 |
+
<div class="flex items-center mb-2">
|
488 |
+
<span class="text-purple-500 mr-2">$</span>
|
489 |
+
<span class="text-gray-400">Dataset Generation Complete</span>
|
490 |
+
</div>
|
491 |
+
<div class="mb-3">
|
492 |
+
<span class="text-xs bg-dark-700 px-2 py-1 rounded">42 items</span>
|
493 |
+
<span class="text-xs bg-dark-700 px-2 py-1 rounded ml-2">Alpaca format</span>
|
494 |
+
</div>
|
495 |
+
<div class="code-block p-3 rounded mb-3">
|
496 |
+
<pre class="whitespace-pre-wrap text-sm">{
|
497 |
+
"instruction": "Explain this Python function",
|
498 |
+
"input": "def add(a, b):\n return a + b",
|
499 |
+
"output": "This function takes two parameters..."
|
500 |
+
}</pre>
|
501 |
+
</div>
|
502 |
+
<div class="flex justify-end mt-2">
|
503 |
+
<button class="text-xs bg-primary-500 hover:bg-primary-600 px-3 py-1 rounded">Download JSON</button>
|
504 |
+
</div>
|
505 |
+
`;
|
506 |
+
|
507 |
+
resultsContainer.prepend(resultDiv);
|
508 |
+
}, 2000);
|
509 |
+
});
|
510 |
+
|
511 |
+
// Refresh DB stats
|
512 |
+
refreshDbBtn.addEventListener('click', function() {
|
513 |
+
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Refreshing...';
|
514 |
+
|
515 |
+
// Simulate refresh
|
516 |
+
setTimeout(() => {
|
517 |
+
docCount.textContent = Math.floor(Math.random() * 10) + 5;
|
518 |
+
chunkCount.textContent = Math.floor(Math.random() * 100) + 50;
|
519 |
+
this.innerHTML = '<i class="fas fa-sync-alt mr-2"></i> Refresh Stats';
|
520 |
+
showMessage('Database stats updated', 'info');
|
521 |
+
}, 1000);
|
522 |
+
});
|
523 |
+
|
524 |
+
// Toggle training section
|
525 |
+
trainingHeader.addEventListener('click', function() {
|
526 |
+
trainingContent.classList.toggle('hidden');
|
527 |
+
trainingArrow.classList.toggle('rotate-180');
|
528 |
+
});
|
529 |
+
|
530 |
+
// Show message function
|
531 |
+
function showMessage(text, type) {
|
532 |
+
const message = document.createElement('div');
|
533 |
+
message.className = `fixed bottom-4 right-4 px-4 py-2 rounded-lg shadow-lg ${
|
534 |
+
type === 'error' ? 'bg-red-600' :
|
535 |
+
type === 'success' ? 'bg-green-600' : 'bg-blue-600'
|
536 |
+
}`;
|
537 |
+
message.textContent = text;
|
538 |
+
document.body.appendChild(message);
|
539 |
+
|
540 |
+
setTimeout(() => {
|
541 |
+
message.remove();
|
542 |
+
}, 3000);
|
543 |
+
}
|
544 |
+
|
545 |
+
// Simulate initial load
|
546 |
+
setTimeout(() => {
|
547 |
+
currentModel.textContent = 'DeepSeek-Coder-6.7B';
|
548 |
+
vramUsage.textContent = '12.4/16 GB';
|
549 |
+
}, 500);
|
550 |
+
</script>
|
551 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=Barbuuuuuuuu/dark-max-ai-server" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Bearbeardog/server" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
552 |
+
</html>
|
prompts.txt
ADDED
File without changes
|