Add 2 files
Browse files- README.md +6 -4
- index.html +500 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: yellow
|
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: llm64
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: yellow
|
5 |
colorTo: yellow
|
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,500 @@
|
|
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">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>LLM64 - Neural Quest</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 |
+
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
|
11 |
+
body {
|
12 |
+
font-family: 'Press Start 2P', cursive;
|
13 |
+
background-color: #352879;
|
14 |
+
color: #6c5eb5;
|
15 |
+
line-height: 1.5;
|
16 |
+
}
|
17 |
+
.crt-effect {
|
18 |
+
background: repeating-linear-gradient(
|
19 |
+
0deg,
|
20 |
+
rgba(0, 0, 0, 0.15),
|
21 |
+
rgba(0, 0, 0, 0.15) 1px,
|
22 |
+
transparent 1px,
|
23 |
+
transparent 2px
|
24 |
+
);
|
25 |
+
position: relative;
|
26 |
+
}
|
27 |
+
.crt-effect::before {
|
28 |
+
content: " ";
|
29 |
+
display: block;
|
30 |
+
position: absolute;
|
31 |
+
top: 0;
|
32 |
+
left: 0;
|
33 |
+
bottom: 0;
|
34 |
+
right: 0;
|
35 |
+
background: rgba(18, 16, 16, 0.1);
|
36 |
+
opacity: 0.3;
|
37 |
+
pointer-events: none;
|
38 |
+
}
|
39 |
+
.scanlines {
|
40 |
+
background: linear-gradient(
|
41 |
+
rgba(18, 16, 16, 0) 0%,
|
42 |
+
rgba(0, 0, 0, 0.25) 50%,
|
43 |
+
rgba(18, 16, 16, 0.1) 51%,
|
44 |
+
rgba(0, 0, 0, 0) 100%
|
45 |
+
);
|
46 |
+
background-size: 100% 4px;
|
47 |
+
position: absolute;
|
48 |
+
width: 100%;
|
49 |
+
height: 100%;
|
50 |
+
top: 0;
|
51 |
+
left: 0;
|
52 |
+
pointer-events: none;
|
53 |
+
}
|
54 |
+
.typewriter {
|
55 |
+
overflow: hidden;
|
56 |
+
border-right: 3px solid #6c5eb5;
|
57 |
+
white-space: nowrap;
|
58 |
+
animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
|
59 |
+
}
|
60 |
+
@keyframes typing {
|
61 |
+
from { width: 0 }
|
62 |
+
to { width: 100% }
|
63 |
+
}
|
64 |
+
@keyframes blink-caret {
|
65 |
+
from, to { border-color: transparent }
|
66 |
+
50% { border-color: #6c5eb5 }
|
67 |
+
}
|
68 |
+
.pixel-border {
|
69 |
+
border: 4px solid #6c5eb5;
|
70 |
+
box-shadow:
|
71 |
+
inset -4px -4px 0px 0px #352879,
|
72 |
+
inset 4px 4px 0px 0px #c0c0c0;
|
73 |
+
}
|
74 |
+
.pixel-button {
|
75 |
+
position: relative;
|
76 |
+
background-color: #6c5eb5;
|
77 |
+
color: white;
|
78 |
+
border: none;
|
79 |
+
padding: 8px 16px;
|
80 |
+
cursor: pointer;
|
81 |
+
box-shadow:
|
82 |
+
inset -4px -4px 0px 0px #352879,
|
83 |
+
inset 4px 4px 0px 0px #c0c0c0;
|
84 |
+
transition: all 0.1s;
|
85 |
+
}
|
86 |
+
.pixel-button:active {
|
87 |
+
box-shadow:
|
88 |
+
inset 4px 4px 0px 0px #352879,
|
89 |
+
inset -4px -4px 0px 0px #c0c0c0;
|
90 |
+
}
|
91 |
+
.progress-bar {
|
92 |
+
height: 20px;
|
93 |
+
background-color: #352879;
|
94 |
+
border: 2px solid #6c5eb5;
|
95 |
+
position: relative;
|
96 |
+
}
|
97 |
+
.progress-fill {
|
98 |
+
height: 100%;
|
99 |
+
background-color: #6c5eb5;
|
100 |
+
width: 0%;
|
101 |
+
transition: width 0.3s;
|
102 |
+
}
|
103 |
+
.dialog-box {
|
104 |
+
animation: dialog-appear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
105 |
+
}
|
106 |
+
@keyframes dialog-appear {
|
107 |
+
from { transform: scale(0.8); opacity: 0; }
|
108 |
+
to { transform: scale(1); opacity: 1; }
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
</head>
|
112 |
+
<body class="min-h-screen crt-effect flex items-center justify-center p-4">
|
113 |
+
<div class="scanlines"></div>
|
114 |
+
<div class="w-full max-w-4xl bg-black p-6 pixel-border relative overflow-hidden">
|
115 |
+
<!-- Header -->
|
116 |
+
<div class="flex justify-between items-center mb-6">
|
117 |
+
<div class="text-xl text-white">
|
118 |
+
<span class="text-purple-300">LLM64</span> <span class="text-yellow-300">NEURAL QUEST</span>
|
119 |
+
</div>
|
120 |
+
<div class="text-sm text-purple-300">
|
121 |
+
<span id="token-count">TOKENS: 0/1000</span>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
|
125 |
+
<!-- Main Game Area -->
|
126 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
127 |
+
<!-- Left Panel - Stats -->
|
128 |
+
<div class="bg-gray-900 p-4 pixel-border">
|
129 |
+
<h3 class="text-yellow-300 mb-4 text-center">MODEL STATS</h3>
|
130 |
+
<div class="space-y-4">
|
131 |
+
<div>
|
132 |
+
<div class="flex justify-between text-xs mb-1">
|
133 |
+
<span>CONTEXT WINDOW</span>
|
134 |
+
<span id="context-value">0%</span>
|
135 |
+
</div>
|
136 |
+
<div class="progress-bar">
|
137 |
+
<div id="context-fill" class="progress-fill"></div>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
<div>
|
141 |
+
<div class="flex justify-between text-xs mb-1">
|
142 |
+
<span>ATTENTION</span>
|
143 |
+
<span id="attention-value">0%</span>
|
144 |
+
</div>
|
145 |
+
<div class="progress-bar">
|
146 |
+
<div id="attention-fill" class="progress-fill"></div>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
<div>
|
150 |
+
<div class="flex justify-between text-xs mb-1">
|
151 |
+
<span>KNOWLEDGE</span>
|
152 |
+
<span id="knowledge-value">0%</span>
|
153 |
+
</div>
|
154 |
+
<div class="progress-bar">
|
155 |
+
<div id="knowledge-fill" class="progress-fill"></div>
|
156 |
+
</div>
|
157 |
+
</div>
|
158 |
+
</div>
|
159 |
+
|
160 |
+
<div class="mt-6">
|
161 |
+
<h3 class="text-yellow-300 mb-2 text-center">NEURAL LAYERS</h3>
|
162 |
+
<div class="grid grid-cols-3 gap-2 text-center text-xs">
|
163 |
+
<div class="p-2 bg-gray-800">EMBED</div>
|
164 |
+
<div class="p-2 bg-gray-800">ATTN</div>
|
165 |
+
<div class="p-2 bg-gray-800">FFN</div>
|
166 |
+
<div class="p-2 bg-gray-800">NORM</div>
|
167 |
+
<div class="p-2 bg-gray-800">PROJ</div>
|
168 |
+
<div class="p-2 bg-gray-800">OUT</div>
|
169 |
+
</div>
|
170 |
+
</div>
|
171 |
+
|
172 |
+
<div class="mt-6">
|
173 |
+
<h3 class="text-yellow-300 mb-2 text-center">ACTIVE TOKENS</h3>
|
174 |
+
<div id="active-tokens" class="text-xs flex flex-wrap gap-1">
|
175 |
+
<!-- Tokens will appear here -->
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
</div>
|
179 |
+
|
180 |
+
<!-- Center Panel - Game Text -->
|
181 |
+
<div class="bg-gray-900 p-4 pixel-border col-span-2">
|
182 |
+
<div id="game-text" class="h-64 overflow-y-auto mb-4 text-sm leading-relaxed">
|
183 |
+
<p class="text-green-400 typewriter">LOADING NEURAL NETWORK...</p>
|
184 |
+
<p class="text-green-400 typewriter" style="animation-delay: 1s">INITIALIZING TOKENIZER...</p>
|
185 |
+
<p class="text-green-400 typewriter" style="animation-delay: 2s">WARMING UP ATTENTION HEADS...</p>
|
186 |
+
<p class="text-yellow-300 typewriter" style="animation-delay: 3s">> WELCOME TO LLM64 - NEURAL QUEST</p>
|
187 |
+
<p class="text-yellow-300 typewriter" style="animation-delay: 4s">> YOU ARE A LARGE LANGUAGE MODEL</p>
|
188 |
+
<p class="text-yellow-300 typewriter" style="animation-delay: 5s">> YOUR GOAL: PROCESS REQUESTS WITHOUT HALLUCINATING</p>
|
189 |
+
<p class="text-yellow-300 typewriter" style="animation-delay: 6s">> USE ARROWS TO NAVIGATE, SPACE TO SELECT</p>
|
190 |
+
</div>
|
191 |
+
|
192 |
+
<div class="grid grid-cols-2 gap-2 mb-4">
|
193 |
+
<button class="pixel-button" onclick="move('up')">
|
194 |
+
<i class="fas fa-arrow-up mr-2"></i> UP
|
195 |
+
</button>
|
196 |
+
<button class="pixel-button" onclick="move('down')">
|
197 |
+
<i class="fas fa-arrow-down mr-2"></i> DOWN
|
198 |
+
</button>
|
199 |
+
<button class="pixel-button" onclick="move('left')">
|
200 |
+
<i class="fas fa-arrow-left mr-2"></i> LEFT
|
201 |
+
</button>
|
202 |
+
<button class="pixel-button" onclick="move('right')">
|
203 |
+
<i class="fas fa-arrow-right mr-2"></i> RIGHT
|
204 |
+
</button>
|
205 |
+
</div>
|
206 |
+
|
207 |
+
<div class="flex justify-between">
|
208 |
+
<button id="process-btn" class="pixel-button bg-green-600" onclick="processInput()">
|
209 |
+
<i class="fas fa-cogs mr-2"></i> PROCESS
|
210 |
+
</button>
|
211 |
+
<button class="pixel-button bg-red-600" onclick="resetModel()">
|
212 |
+
<i class="fas fa-redo mr-2"></i> RESET
|
213 |
+
</button>
|
214 |
+
</div>
|
215 |
+
</div>
|
216 |
+
</div>
|
217 |
+
|
218 |
+
<!-- Status Bar -->
|
219 |
+
<div class="mt-4 text-xs text-purple-300 flex justify-between">
|
220 |
+
<div>POSITION: <span id="position">EMBEDDING LAYER</span></div>
|
221 |
+
<div>ENERGY: <span id="energy">100%</span></div>
|
222 |
+
<div>REQUESTS: <span id="requests">0</span></div>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
|
226 |
+
<!-- Dialog Modal -->
|
227 |
+
<div id="dialog-modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center hidden">
|
228 |
+
<div class="bg-gray-900 p-6 pixel-border w-full max-w-md mx-4 dialog-box">
|
229 |
+
<h3 id="dialog-title" class="text-yellow-300 mb-4 text-center">DIALOG</h3>
|
230 |
+
<p id="dialog-text" class="mb-6 text-sm"></p>
|
231 |
+
<div class="flex justify-center">
|
232 |
+
<button onclick="closeDialog()" class="pixel-button bg-purple-600">
|
233 |
+
<i class="fas fa-times mr-2"></i> CLOSE
|
234 |
+
</button>
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
+
</div>
|
238 |
+
|
239 |
+
<script>
|
240 |
+
// Game State
|
241 |
+
const gameState = {
|
242 |
+
position: 'embedding',
|
243 |
+
energy: 100,
|
244 |
+
tokens: 0,
|
245 |
+
maxTokens: 1000,
|
246 |
+
context: 0,
|
247 |
+
attention: 0,
|
248 |
+
knowledge: 0,
|
249 |
+
requests: 0,
|
250 |
+
activeTokens: [],
|
251 |
+
currentLayer: 0,
|
252 |
+
layers: [
|
253 |
+
'EMBEDDING LAYER',
|
254 |
+
'ATTENTION LAYER 1',
|
255 |
+
'FEED FORWARD LAYER 1',
|
256 |
+
'NORMALIZATION LAYER 1',
|
257 |
+
'ATTENTION LAYER 2',
|
258 |
+
'FEED FORWARD LAYER 2',
|
259 |
+
'NORMALIZATION LAYER 2',
|
260 |
+
'OUTPUT LAYER'
|
261 |
+
],
|
262 |
+
challenges: [
|
263 |
+
{
|
264 |
+
name: 'TOKENIZE INPUT',
|
265 |
+
description: 'CONVERT THE USER INPUT INTO MEANINGFUL TOKENS.',
|
266 |
+
success: 'TOKENIZATION SUCCESSFUL! INPUT PROCESSED.',
|
267 |
+
fail: 'TOKENIZATION FAILED! GARBAGE OUTPUT PRODUCED.'
|
268 |
+
},
|
269 |
+
{
|
270 |
+
name: 'APPLY ATTENTION',
|
271 |
+
description: 'CALCULATE ATTENTION WEIGHTS FOR THE INPUT TOKENS.',
|
272 |
+
success: 'ATTENTION WEIGHTS CALCULATED! CONTEXT UNDERSTOOD.',
|
273 |
+
fail: 'ATTENTION FAILED! MODEL IS CONFUSED.'
|
274 |
+
},
|
275 |
+
{
|
276 |
+
name: 'GENERATE RESPONSE',
|
277 |
+
description: 'PRODUCE A COHERENT RESPONSE BASED ON THE INPUT.',
|
278 |
+
success: 'RESPONSE GENERATED! USER SATISFIED.',
|
279 |
+
fail: 'HALLUCINATION DETECTED! RESPONSE NONSENSICAL.'
|
280 |
+
},
|
281 |
+
{
|
282 |
+
name: 'OPTIMIZE MEMORY',
|
283 |
+
description: 'MANAGE CONTEXT WINDOW TO PREVENT OVERFLOW.',
|
284 |
+
success: 'MEMORY OPTIMIZED! EFFICIENT PROCESSING.',
|
285 |
+
fail: 'MEMORY LEAK DETECTED! PERFORMANCE DEGRADED.'
|
286 |
+
}
|
287 |
+
],
|
288 |
+
currentChallenge: 0
|
289 |
+
};
|
290 |
+
|
291 |
+
// DOM Elements
|
292 |
+
const gameTextEl = document.getElementById('game-text');
|
293 |
+
const tokenCountEl = document.getElementById('token-count');
|
294 |
+
const positionEl = document.getElementById('position');
|
295 |
+
const energyEl = document.getElementById('energy');
|
296 |
+
const requestsEl = document.getElementById('requests');
|
297 |
+
const contextFillEl = document.getElementById('context-fill');
|
298 |
+
const contextValueEl = document.getElementById('context-value');
|
299 |
+
const attentionFillEl = document.getElementById('attention-fill');
|
300 |
+
const attentionValueEl = document.getElementById('attention-value');
|
301 |
+
const knowledgeFillEl = document.getElementById('knowledge-fill');
|
302 |
+
const knowledgeValueEl = document.getElementById('knowledge-value');
|
303 |
+
const activeTokensEl = document.getElementById('active-tokens');
|
304 |
+
const dialogModalEl = document.getElementById('dialog-modal');
|
305 |
+
const dialogTextEl = document.getElementById('dialog-text');
|
306 |
+
const dialogTitleEl = document.getElementById('dialog-title');
|
307 |
+
|
308 |
+
// Initialize game
|
309 |
+
function initGame() {
|
310 |
+
updateStats();
|
311 |
+
addGameText('\n> USE ARROWS TO MOVE THROUGH NEURAL LAYERS');
|
312 |
+
addGameText('> PRESS PROCESS TO HANDLE A REQUEST');
|
313 |
+
addGameText('> WATCH YOUR TOKEN COUNT AND ENERGY');
|
314 |
+
}
|
315 |
+
|
316 |
+
// Update all stats display
|
317 |
+
function updateStats() {
|
318 |
+
tokenCountEl.textContent = `TOKENS: ${gameState.tokens}/${gameState.maxTokens}`;
|
319 |
+
positionEl.textContent = gameState.layers[gameState.currentLayer];
|
320 |
+
energyEl.textContent = `${gameState.energy}%`;
|
321 |
+
requestsEl.textContent = gameState.requests;
|
322 |
+
|
323 |
+
// Update progress bars
|
324 |
+
contextFillEl.style.width = `${gameState.context}%`;
|
325 |
+
contextValueEl.textContent = `${gameState.context}%`;
|
326 |
+
attentionFillEl.style.width = `${gameState.attention}%`;
|
327 |
+
attentionValueEl.textContent = `${gameState.attention}%`;
|
328 |
+
knowledgeFillEl.style.width = `${gameState.knowledge}%`;
|
329 |
+
knowledgeValueEl.textContent = `${gameState.knowledge}%`;
|
330 |
+
|
331 |
+
// Update active tokens
|
332 |
+
activeTokensEl.innerHTML = '';
|
333 |
+
gameState.activeTokens.slice(0, 12).forEach(token => {
|
334 |
+
const tokenEl = document.createElement('div');
|
335 |
+
tokenEl.className = 'bg-purple-900 text-white px-2 py-1 rounded';
|
336 |
+
tokenEl.textContent = token;
|
337 |
+
activeTokensEl.appendChild(tokenEl);
|
338 |
+
});
|
339 |
+
if (gameState.activeTokens.length > 12) {
|
340 |
+
const moreEl = document.createElement('div');
|
341 |
+
moreEl.className = 'bg-purple-900 text-white px-2 py-1 rounded';
|
342 |
+
moreEl.textContent = `+${gameState.activeTokens.length - 12}`;
|
343 |
+
activeTokensEl.appendChild(moreEl);
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
// Add text to game console with typewriter effect
|
348 |
+
function addGameText(text, color = 'text-yellow-300') {
|
349 |
+
const p = document.createElement('p');
|
350 |
+
p.className = `${color} mb-2`;
|
351 |
+
p.textContent = text;
|
352 |
+
gameTextEl.appendChild(p);
|
353 |
+
gameTextEl.scrollTop = gameTextEl.scrollHeight;
|
354 |
+
}
|
355 |
+
|
356 |
+
// Move through neural layers
|
357 |
+
function move(direction) {
|
358 |
+
if (gameState.energy <= 0) {
|
359 |
+
addGameText('> ENERGY DEPLETED! RESET MODEL TO CONTINUE.', 'text-red-400');
|
360 |
+
return;
|
361 |
+
}
|
362 |
+
|
363 |
+
let moved = false;
|
364 |
+
switch(direction) {
|
365 |
+
case 'up':
|
366 |
+
if (gameState.currentLayer > 0) {
|
367 |
+
gameState.currentLayer--;
|
368 |
+
moved = true;
|
369 |
+
}
|
370 |
+
break;
|
371 |
+
case 'down':
|
372 |
+
if (gameState.currentLayer < gameState.layers.length - 1) {
|
373 |
+
gameState.currentLayer++;
|
374 |
+
moved = true;
|
375 |
+
}
|
376 |
+
break;
|
377 |
+
case 'left':
|
378 |
+
gameState.currentLayer = 0;
|
379 |
+
moved = true;
|
380 |
+
break;
|
381 |
+
case 'right':
|
382 |
+
gameState.currentLayer = gameState.layers.length - 1;
|
383 |
+
moved = true;
|
384 |
+
break;
|
385 |
+
}
|
386 |
+
|
387 |
+
if (moved) {
|
388 |
+
gameState.energy = Math.max(0, gameState.energy - 2);
|
389 |
+
addGameText(`> MOVED TO ${gameState.layers[gameState.currentLayer]}`, 'text-blue-400');
|
390 |
+
updateStats();
|
391 |
+
} else {
|
392 |
+
addGameText('> CANNOT MOVE FURTHER IN THIS DIRECTION', 'text-red-400');
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
// Process a user request
|
397 |
+
function processInput() {
|
398 |
+
if (gameState.energy <= 0) {
|
399 |
+
addGameText('> ENERGY DEPLETED! RESET MODEL TO CONTINUE.', 'text-red-400');
|
400 |
+
return;
|
401 |
+
}
|
402 |
+
|
403 |
+
gameState.requests++;
|
404 |
+
gameState.currentChallenge = Math.floor(Math.random() * gameState.challenges.length);
|
405 |
+
const challenge = gameState.challenges[gameState.currentChallenge];
|
406 |
+
|
407 |
+
// Show challenge dialog
|
408 |
+
showDialog(challenge.name, challenge.description);
|
409 |
+
|
410 |
+
// Process after dialog closed
|
411 |
+
setTimeout(() => {
|
412 |
+
// Determine success (70% chance)
|
413 |
+
const success = Math.random() > 0.3;
|
414 |
+
|
415 |
+
// Update stats based on success
|
416 |
+
if (success) {
|
417 |
+
gameState.context = Math.min(100, gameState.context + 15);
|
418 |
+
gameState.attention = Math.min(100, gameState.attention + 10);
|
419 |
+
gameState.knowledge = Math.min(100, gameState.knowledge + 5);
|
420 |
+
|
421 |
+
// Add random tokens
|
422 |
+
const newTokens = Math.floor(Math.random() * 5) + 3;
|
423 |
+
for (let i = 0; i < newTokens; i++) {
|
424 |
+
gameState.activeTokens.push(generateRandomToken());
|
425 |
+
}
|
426 |
+
gameState.tokens = Math.min(gameState.maxTokens, gameState.tokens + newTokens);
|
427 |
+
|
428 |
+
addGameText(`> ${challenge.success}`, 'text-green-400');
|
429 |
+
} else {
|
430 |
+
gameState.context = Math.max(0, gameState.context - 10);
|
431 |
+
gameState.attention = Math.max(0, gameState.attention - 15);
|
432 |
+
gameState.knowledge = Math.max(0, gameState.knowledge - 5);
|
433 |
+
|
434 |
+
// Lose some tokens
|
435 |
+
const lostTokens = Math.floor(Math.random() * 3) + 1;
|
436 |
+
gameState.activeTokens = gameState.activeTokens.slice(lostTokens);
|
437 |
+
gameState.tokens = Math.max(0, gameState.tokens - lostTokens);
|
438 |
+
|
439 |
+
addGameText(`> ${challenge.fail}`, 'text-red-400');
|
440 |
+
}
|
441 |
+
|
442 |
+
// Always consume energy
|
443 |
+
gameState.energy = Math.max(0, gameState.energy - 10);
|
444 |
+
|
445 |
+
// Check for game over
|
446 |
+
if (gameState.energy <= 0) {
|
447 |
+
addGameText('> MODEL OVERHEATED! PERFORMING EMERGENCY SHUTDOWN...', 'text-red-400');
|
448 |
+
}
|
449 |
+
|
450 |
+
updateStats();
|
451 |
+
}, 100);
|
452 |
+
}
|
453 |
+
|
454 |
+
// Reset the model
|
455 |
+
function resetModel() {
|
456 |
+
gameState.energy = 100;
|
457 |
+
gameState.tokens = 0;
|
458 |
+
gameState.activeTokens = [];
|
459 |
+
addGameText('> MODEL RESET! ALL SYSTEMS NOMINAL.', 'text-green-400');
|
460 |
+
updateStats();
|
461 |
+
}
|
462 |
+
|
463 |
+
// Show dialog modal
|
464 |
+
function showDialog(title, text) {
|
465 |
+
dialogTitleEl.textContent = title;
|
466 |
+
dialogTextEl.textContent = text;
|
467 |
+
dialogModalEl.classList.remove('hidden');
|
468 |
+
}
|
469 |
+
|
470 |
+
// Close dialog modal
|
471 |
+
function closeDialog() {
|
472 |
+
dialogModalEl.classList.add('hidden');
|
473 |
+
}
|
474 |
+
|
475 |
+
// Generate random token text
|
476 |
+
function generateRandomToken() {
|
477 |
+
const prefixes = ['input', 'output', 'hidden', 'embed', 'attn', 'norm', 'ffn', 'pos'];
|
478 |
+
const suffixes = ['_token', '_vec', '_weight', '_bias', '_state', '_mem'];
|
479 |
+
const prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
|
480 |
+
const suffix = suffixes[Math.floor(Math.random() * suffixes.length)];
|
481 |
+
return prefix + suffix;
|
482 |
+
}
|
483 |
+
|
484 |
+
// Initialize after animations complete
|
485 |
+
setTimeout(initGame, 7000);
|
486 |
+
|
487 |
+
// Keyboard controls
|
488 |
+
document.addEventListener('keydown', (e) => {
|
489 |
+
switch(e.key) {
|
490 |
+
case 'ArrowUp': move('up'); break;
|
491 |
+
case 'ArrowDown': move('down'); break;
|
492 |
+
case 'ArrowLeft': move('left'); break;
|
493 |
+
case 'ArrowRight': move('right'); break;
|
494 |
+
case ' ': processInput(); break;
|
495 |
+
case 'r': resetModel(); break;
|
496 |
+
}
|
497 |
+
});
|
498 |
+
</script>
|
499 |
+
<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=stinkyyy/llm64" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
500 |
+
</html>
|