ZavalaCubas commited on
Commit
be73cf0
·
verified ·
1 Parent(s): 6891a8a

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +221 -19
index.html CHANGED
@@ -2,28 +2,230 @@
2
  <html lang="es">
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>Zavala Cubas · AI Agent Studio (smolagents)</title>
 
6
  <style>
7
- body { font-family: Inter, system-ui, sans-serif; background: #0f172a; color: #f8fafc; margin: 0; padding: 48px 24px; }
8
- .card { max-width: 780px; margin: auto; background: #1e293b; border: 1px solid #334155; border-radius: 16px; padding: 32px; }
9
- h1 { margin-top: 0; font-size: 1.6rem; }
10
- .badge { display: inline-block; background: #4f46e5; color: white; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; margin-bottom: 16px; }
11
- code { background: #0f172a; padding: 3px 8px; border-radius: 6px; color: #38bdf8; }
12
- a { color: #818cf8; text-decoration: none; font-weight: 600; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  </style>
14
  </head>
15
  <body>
16
- <div class="card">
17
- <span class="badge">Hugging Face Agents Course · Unit 1</span>
18
- <h1>⚡ AI Agent Studio · CodeAgent</h1>
19
- <p>Agente construido con <code>smolagents</code> + <code>Gradio 6.0</code> + <code>LiteLLMModel (qwen2:7b)</code>.</p>
20
- <h3>🛠️ Herramientas incluidas en este repositorio:</h3>
21
- <ul>
22
- <li><code>check_brand_voice_rule</code>: Herramienta personalizada (<code>@tool</code>) de gobernanza y criterio de voz de marca.</li>
23
- <li><code>get_current_time_in_timezone</code>: Consulta de hora global en tiempo real con <code>pytz</code>.</li>
24
- <li><code>DuckDuckGoSearchTool</code> + <code>python_interpreter</code> (ReAct CodeAgent).</li>
25
- </ul>
26
- <p>📂 <a href="https://huggingface.co/spaces/ZavalaCubas/First_agent_template/tree/main" target="_blank">Ver código fuente (app.py y brand_voice_tool/tool.py) →</a></p>
 
 
 
 
 
 
 
 
 
 
 
27
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </body>
29
- </html>
 
2
  <html lang="es">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>402 Pixel Agent · Zavala Cubas</title>
6
+ <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600&display=swap" rel="stylesheet">
7
  <style>
8
+ * { box-sizing: border-box; }
9
+ body {
10
+ background: #090d16;
11
+ color: #e2e8f0;
12
+ font-family: "Inter", system-ui, sans-serif;
13
+ margin: 0;
14
+ padding: 28px 16px;
15
+ display: flex;
16
+ justify-content: center;
17
+ }
18
+ .arcade-cabinet {
19
+ max-width: 820px;
20
+ width: 100%;
21
+ background: #111827;
22
+ border: 4px solid #4f46e5;
23
+ border-radius: 12px;
24
+ box-shadow: 0 0 35px rgba(79, 70, 229, 0.35);
25
+ padding: 24px;
26
+ }
27
+ .pixel-title {
28
+ font-family: "Press Start 2P", monospace;
29
+ font-size: 1rem;
30
+ color: #facc15;
31
+ text-align: center;
32
+ line-height: 1.6;
33
+ margin: 0 0 16px 0;
34
+ text-shadow: 2px 2px #991b1b;
35
+ }
36
+ .screen-wrapper {
37
+ background: #020617;
38
+ border: 4px solid #334155;
39
+ border-radius: 8px;
40
+ padding: 12px;
41
+ position: relative;
42
+ text-align: center;
43
+ }
44
+ canvas {
45
+ image-rendering: pixelated;
46
+ width: 100%;
47
+ max-width: 740px;
48
+ height: auto;
49
+ background: #050811;
50
+ border: 2px solid #1e293b;
51
+ }
52
+ .dialogue-box {
53
+ font-family: "Press Start 2P", monospace;
54
+ background: #0f172a;
55
+ border: 3px solid #38bdf8;
56
+ color: #38bdf8;
57
+ padding: 14px;
58
+ margin-top: 14px;
59
+ font-size: 0.72rem;
60
+ line-height: 1.75;
61
+ text-align: left;
62
+ min-height: 92px;
63
+ }
64
+ .controls {
65
+ display: flex;
66
+ gap: 12px;
67
+ flex-wrap: wrap;
68
+ margin-top: 16px;
69
+ justify-content: center;
70
+ }
71
+ .btn-pixel {
72
+ font-family: "Press Start 2P", monospace;
73
+ font-size: 0.68rem;
74
+ padding: 12px 16px;
75
+ border: 3px solid #f8fafc;
76
+ cursor: pointer;
77
+ text-decoration: none;
78
+ transition: transform 0.1s;
79
+ }
80
+ .btn-pixel:active { transform: translateY(3px); }
81
+ .btn-coin { background: #dc2626; color: #fff; }
82
+ .btn-code { background: #16a34a; color: #fff; }
83
+ .specs {
84
+ margin-top: 20px;
85
+ padding-top: 16px;
86
+ border-top: 1px dashed #334155;
87
+ font-size: 0.88rem;
88
+ color: #94a3b8;
89
+ display: flex;
90
+ justify-content: space-between;
91
+ flex-wrap: wrap;
92
+ gap: 10px;
93
+ }
94
+ .specs code { color: #a5b4fc; background: #1e293b; padding: 2px 6px; border-radius: 4px; }
95
  </style>
96
  </head>
97
  <body>
98
+ <div class="arcade-cabinet">
99
+ <h1 class="pixel-title">🕹️ ERROR 402: NO PAGUÉ EL PRO DE HUGGING FACE</h1>
100
+
101
+ <div class="screen-wrapper">
102
+ <canvas id="memeCanvas" width="370" height="170"></canvas>
103
+ <div class="dialogue-box" id="consoleText">
104
+ > THOUGHT: Intentando arrancar Gradio en la nube gratis...<br>
105
+ > ACTION: deploy_to_hf_space(budget=0.00)<br>
106
+ > OBSERVATION: Error 402 Payment Required. El agente vive como un rey en mi MacBook Pro (Ollama + qwen2:7b), pero aquí solo puedes admirar mi código.
107
+ </div>
108
+ </div>
109
+
110
+ <div class="controls">
111
+ <button class="btn-pixel btn-coin" onclick="insertZeroCoin()">🪙 INSERTAR 0.00€ (PEDIR CPU GRATIS)</button>
112
+ <a class="btn-pixel btn-code" href="https://huggingface.co/spaces/ZavalaCubas/First_agent_template/tree/main" target="_blank">📂 VER EL CÓDIGO REAL (app.py) →</a>
113
+ </div>
114
+
115
+ <div class="specs">
116
+ <div>🧠 <b>Motor Local:</b> <code>Ollama + qwen2:7b</code> (0.00€)</div>
117
+ <div>🛠️ <b>Tools:</b> <code>check_brand_voice_rule</code> · <code>pytz</code> · <code>CodeAgent</code></div>
118
+ <div>💸 <b>Gasto Cloud:</b> <code>$0.00 / mes</code></div>
119
+ </div>
120
  </div>
121
+
122
+ <script>
123
+ const canvas = document.getElementById("memeCanvas");
124
+ const ctx = canvas.getContext("2d");
125
+ let frame = 0;
126
+ let coinAnim = 0;
127
+
128
+ const jokes = [
129
+ "> THOUGHT: ¿Pagar 9$/mes por una CPU básica cuando tengo un MacBook Pro M-Series?<br>> ACTION: run_locally(model=\"qwen2:7b\", port=11434)<br>> OBSERVATION: 2.7 segundos por respuesta en local. 0€ gastados. Victoria estratégica.",
130
+ "> THOUGHT: El visitante quiere chatear con el agente en esta pestaña...<br>> ACTION: check_subscription_status()<br>> OBSERVATION: Modo F2P activado. Descarga app.py en la pestaña Files o invita un café para desbloquear el servidor.",
131
+ "> THOUGHT: Revisando regla de voz de marca con @tool check_brand_voice_rule...<br>> ACTION: final_answer(\"Estrategia antes que alquilar servidores innecesarios.\")<br>> OBSERVATION: El código está 100% operativo en Files/app.py."
132
+ ];
133
+ let jokeIdx = 0;
134
+
135
+ function insertZeroCoin() {
136
+ coinAnim = 30;
137
+ jokeIdx = (jokeIdx + 1) % jokes.length;
138
+ document.getElementById("consoleText").innerHTML = jokes[jokeIdx];
139
+ }
140
+
141
+ function drawPixelRect(x, y, w, h, color) {
142
+ ctx.fillStyle = color;
143
+ ctx.fillRect(Math.floor(x), Math.floor(y), w, h);
144
+ }
145
+
146
+ function render() {
147
+ frame++;
148
+ ctx.fillStyle = "#060913";
149
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
150
+
151
+ // Divisor central
152
+ drawPixelRect(184, 10, 2, 150, "#1e293b");
153
+
154
+ // LADO IZQUIERDO: HUGGING FACE CLOUD (JAULA 402)
155
+ ctx.fillStyle = "#ef4444";
156
+ ctx.font = "8px monospace";
157
+ ctx.fillText("☁️ HF CLOUD (SIN PRO)", 28, 22);
158
+
159
+ // Robot Agente triste en la jaula
160
+ const bob = Math.sin(frame * 0.1) * 3;
161
+ // Cabeza robot
162
+ drawPixelRect(72, 65 + bob, 36, 28, "#64748b");
163
+ drawPixelRect(88, 55 + bob, 4, 10, "#94a3b8");
164
+ drawPixelRect(86, 51 + bob, 8, 5, frame % 20 < 10 ? "#ef4444" : "#7f1d1d"); // antena
165
+ // Ojos X X
166
+ drawPixelRect(78, 73 + bob, 6, 6, "#facc15");
167
+ drawPixelRect(96, 73 + bob, 6, 6, "#facc15");
168
+ // Boca triste
169
+ drawPixelRect(82, 85 + bob, 16, 3, "#0f172a");
170
+ // Cuerpo
171
+ drawPixelRect(68, 95 + bob, 44, 32, "#475569");
172
+ ctx.fillStyle = "#f8fafc";
173
+ ctx.fillText("402", 81, 114 + bob);
174
+
175
+ // Barrotes láser rojos de la jaula
176
+ for (let i = 45; i <= 135; i += 18) {
177
+ drawPixelRect(i, 42, 3, 95, frame % 40 < 35 ? "#dc2626" : "#f87171");
178
+ }
179
+ drawPixelRect(40, 40, 100, 4, "#334155");
180
+ drawPixelRect(40, 136, 100, 4, "#334155");
181
+
182
+ // Cartel Paywall
183
+ drawPixelRect(35, 145, 110, 16, "#7f1d1d");
184
+ ctx.fillStyle = "#fca5a5";
185
+ ctx.fillText("LOCKED: PAY $9/MO", 43, 156);
186
+
187
+ // LADO DERECHO: MACBOOK LOCAL CON OLLAMA (FIESTA)
188
+ ctx.fillStyle = "#4ade80";
189
+ ctx.fillText("💻 MI MACBOOK (LOCAL)", 218, 22);
190
+
191
+ // Aura de velocidad verde
192
+ const pulse = Math.abs(Math.sin(frame * 0.15)) * 6;
193
+ drawPixelRect(235 - pulse/2, 58 - pulse/2, 80 + pulse, 55 + pulse, "#052e16");
194
+
195
+ // Pantalla del Mac
196
+ drawPixelRect(240, 62, 70, 46, "#334155");
197
+ drawPixelRect(244, 66, 62, 38, "#0f172a");
198
+ // Código corriendo en el Mac
199
+ ctx.fillStyle = "#22c55e";
200
+ const codeScroll = (frame % 20);
201
+ drawPixelRect(248, 72, 35, 3, "#22c55e");
202
+ drawPixelRect(248, 79, 50, 3, "#38bdf8");
203
+ drawPixelRect(248, 86, 28, 3, "#facc15");
204
+ drawPixelRect(248, 93, 44, 3, "#a855f7");
205
+ // Base del teclado Mac
206
+ drawPixelRect(230, 108, 90, 6, "#94a3b8");
207
+ drawPixelRect(265, 108, 20, 3, "#64748b");
208
+
209
+ // Etiqueta de éxito
210
+ drawPixelRect(212, 125, 128, 16, "#14532d");
211
+ ctx.fillStyle = "#86efac";
212
+ ctx.fillText("qwen2:7b -> 2.7s (FREE)", 218, 136);
213
+
214
+ ctx.fillStyle = "#facc15";
215
+ ctx.fillText("COSTE API: 0.00 EUR", 225, 155);
216
+
217
+ // Animación de moneda 0€ rebotando cuando pulsan el botón
218
+ if (coinAnim > 0) {
219
+ coinAnim--;
220
+ const cy = 35 - Math.sin(coinAnim * 0.3) * 18;
221
+ drawPixelRect(82, cy, 16, 16, "#facc15");
222
+ ctx.fillStyle = "#000";
223
+ ctx.fillText("0€", 85, cy + 11);
224
+ }
225
+
226
+ requestAnimationFrame(render);
227
+ }
228
+ render();
229
+ </script>
230
  </body>
231
+ </html>