Upload folder using huggingface_hub
Browse files- ARCHITECTURE.md +15 -5
- STATUS.md +58 -43
- app.py +4 -1
- assets/case_bank.json +1 -97
ARCHITECTURE.md
CHANGED
|
@@ -45,12 +45,22 @@ Rangos: ROOKIE (3s, rueda 4) → DETECTIVE (2s, 6) → INSPECTOR (1.5s, 6 + disf
|
|
| 45 |
| `tests/test_engine.py` | QA: testimonios límite, equidad por simulación (400 partidas), bounds |
|
| 46 |
| `deploy.sh` | Sube el Space a la org (idempotente) |
|
| 47 |
|
| 48 |
-
## Modelos en runtime (~
|
| 49 |
|
| 50 |
-
- `Fcabla/MiniCPM5-1B-eyewitness` (1.08B, LoRA
|
| 51 |
-
|
| 52 |
-
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
## Infra
|
| 56 |
|
|
|
|
| 45 |
| `tests/test_engine.py` | QA: testimonios límite, equidad por simulación (400 partidas), bounds |
|
| 46 |
| `deploy.sh` | Sube el Space a la org (idempotente) |
|
| 47 |
|
| 48 |
+
## Modelos en runtime (~4.5B total)
|
| 49 |
|
| 50 |
+
- `Fcabla/MiniCPM5-1B-eyewitness` (1.08B, LoRA) — parser de testimonios (SOLO sabe slot-filling:
|
| 51 |
+
olvido catastrófico verificado — balbucea dataset en prompts abiertos).
|
| 52 |
+
- `openbmb/MiniCPM5-1B` base (1.08B) — escribe la pulla personalizada del veredicto desde el
|
| 53 |
+
diff dijiste/verdad (`culprit_taunt`). `enable_thinking=False` obligatorio (modelo razonador).
|
| 54 |
+
- VoxCPM2 (2.29B) — voz del veredicto EN VIVO clonando un anchor (`game/voice.py`); banco
|
| 55 |
+
pre-renderizado como fallback. Audio siempre en memoria (48000, int16) — gr.Audio con rutas
|
| 56 |
+
fuera de allowed dirs revienta el render.
|
| 57 |
+
|
| 58 |
+
**Cascada del veredicto**: pulla viva → voz viva → banco enlatado → solo texto. Cada `except`
|
| 59 |
+
loguea su causa (`[taunt]`/`[voice]` en logs del Space).
|
| 60 |
+
|
| 61 |
+
**Patrón ZeroGPU**: `preload()` carga los 3 modelos a CPU en el arranque; las funciones
|
| 62 |
+
`@spaces.GPU` (20s parser/pulla, 30s voz) solo transfieren y generan. La cuota ZeroGPU admite
|
| 63 |
+
por duración SOLICITADA — pedir de más = llamadas rechazadas para usuarios con poca cuota.
|
| 64 |
|
| 65 |
## Infra
|
| 66 |
|
STATUS.md
CHANGED
|
@@ -1,43 +1,58 @@
|
|
| 1 |
-
# EYEWITNESS — Estado
|
| 2 |
-
|
| 3 |
-
##
|
| 4 |
-
|
| 5 |
-
|
|
| 6 |
-
|---|---|
|
| 7 |
-
|
|
| 8 |
-
|
|
| 9 |
-
|
|
| 10 |
-
|
|
| 11 |
-
|
|
| 12 |
-
|
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
`
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EYEWITNESS — Estado y backlog de iteración (12 jun 2026, mañana)
|
| 2 |
+
|
| 3 |
+
## Estado del sistema
|
| 4 |
+
|
| 5 |
+
| Componente | Estado | Evidencia |
|
| 6 |
+
|---|---|---|
|
| 7 |
+
| Juego core completo en el Space (ZeroGPU) | ✅ estable | múltiples rondas verificadas en prod |
|
| 8 |
+
| Parser fine-tune (`Fcabla/MiniCPM5-1B-eyewitness`) | ✅ en vivo | "caterpillar eyebrows"→retrato correcto |
|
| 9 |
+
| Pulla viva (1B base) + voz viva (VoxCPM2 anchor) | ✅ mecánicamente / ⚠️ calidad | logs `[taunt] ok`+`[voice] ok 3-4s`; pero ver backlog F2/F3 |
|
| 10 |
+
| Preload canónico ZeroGPU + duraciones 20/30s | ✅ | `[startup] models preloaded`; quota-admisible |
|
| 11 |
+
| Cascada de fallbacks | ✅ probada | nunca rompió prod en ningún fallo |
|
| 12 |
+
| Banco casos/voces/anchors (Modal) | ✅ | verificados por transcripción whisper |
|
| 13 |
+
|
| 14 |
+
Latencia percibida: aceptable (palabra de Fernando). GitHub/dataset/model publicados.
|
| 15 |
+
|
| 16 |
+
## BACKLOG DE FEEDBACK (Fernando, 12 jun) — por orden de ataque
|
| 17 |
+
|
| 18 |
+
- **F1 · UI: textos invisibles sobre fondo blanco (light mode)** — bug de contraste; además pase
|
| 19 |
+
general /frontend-design ("hay que pulir más"). *Primera tarea: reproducir en light mode.*
|
| 20 |
+
- **F2 · Calidad de las pullas**: el 1B confunde la voz narrativa (habla como testigo, no como
|
| 21 |
+
ladrón) y no se percibe la personalización. Diagnóstico en logs: `"A headache! I never noticed
|
| 22 |
+
your fancy hat!"`. Candidatos: prompt más restringido, temperatura menor, o plantilla
|
| 23 |
+
determinista desde el diff + el modelo solo adorna (honest fit). **Probar en local con la 4090.**
|
| 24 |
+
- **F3 · Voz: siempre suena la misma (femenina), alta y regular.** Los 3 anchors no se
|
| 25 |
+
diferenciaron — VoxCPM2 LEYÓ las descripciones de estilo pero no las OBEDECIÓ (gamble fallido).
|
| 26 |
+
Plan: con la 4090 local, generar ~20 candidatos de anchor, medir pitch (f0) y elegir 3
|
| 27 |
+
genuinamente distintos (grave/medio/agudo) + normalizar volumen (está clipeando o muy alto).
|
| 28 |
+
- **F4 · "No queda claro qué modelo hace qué en cada momento"** — UX de visibilidad del modelo:
|
| 29 |
+
badges por pantalla ("MiniCPM5-1B parseando tu testimonio…"), el cuaderno del retratista
|
| 30 |
+
(mapeo palabra→atributo visible), retrato construyéndose rasgo a rasgo.
|
| 31 |
+
- **F5 · Testimonio HABLADO** (idea Fernando): ASR para hablar en vez de escribir.
|
| 32 |
+
Opciones: **Cohere Transcribe 2B** (sponsor, verbatim, ES+EN — la opción natural; sube runtime
|
| 33 |
+
a ~5.7B, sigue ≤32B sobrado), o Whisper small. Encaja con la fantasía de testigo declarando.
|
| 34 |
+
- **F6 · Imagen realista del sospechoso** (idea Fernando): generar una "foto policial" realista
|
| 35 |
+
desde el retrato/atributos, al final o en el loop. Opciones: img2img/ControlNet sobre el SVG,
|
| 36 |
+
SDXL-Turbo (~3.5B) o FLUX (12B, rompe presupuesto Tiny Titan si computa runtime). Pesada:
|
| 37 |
+
evaluar coste/beneficio DESPUÉS de F1-F4. Posible modo "ficha policial final" como recompensa.
|
| 38 |
+
|
| 39 |
+
## Recursos nuevos
|
| 40 |
+
|
| 41 |
+
- **RTX 4090 local disponible** — probar modelos/voces/prompts en local, sin quemar cuota
|
| 42 |
+
ZeroGPU ni ciclos de deploy. (Falta instalar torch CUDA en el venv; los drivers ya están.)
|
| 43 |
+
|
| 44 |
+
## Lecciones ZeroGPU (no repetir)
|
| 45 |
+
|
| 46 |
+
1. La cuota ADMITE por duración SOLICITADA vs restante — pedir 90s "por seguridad" hace
|
| 47 |
+
inadmisibles las llamadas. Pedir pequeño (20-30s).
|
| 48 |
+
2. Patrón canónico: cargar modelos a CPU en el arranque (`preload()` en `__main__`), `.to(cuda)`
|
| 49 |
+
dentro de la función `@spaces.GPU` — las llamadas pasan de 30-60s a 3-8s.
|
| 50 |
+
3. Los usuarios anónimos pueden tener 0s de cuota → la cascada de fallbacks no es opcional.
|
| 51 |
+
4. El bloque `__main__` no se ejercita con `from app import demo` — usar `compile()` del fichero.
|
| 52 |
+
|
| 53 |
+
## Lo que NO está en discusión (congelado)
|
| 54 |
+
|
| 55 |
+
Mecánica del juego, motor de caras, rueda-desde-errores, scoring transparente, póster,
|
| 56 |
+
deploy pipeline. La iteración es: UI/contraste, calidad pulla+voz, visibilidad del modelo,
|
| 57 |
+
y (si hay margen) ASR y/o imagen realista. **El vídeo de submission sigue siendo el único
|
| 58 |
+
entregable duro pendiente — deadline 15 jun.**
|
app.py
CHANGED
|
@@ -169,7 +169,10 @@ def next_case(s: dict) -> dict:
|
|
| 169 |
CSS = """
|
| 170 |
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');
|
| 171 |
:root { --paper:#f4efe4; --ink:#2b2a28; --red:#a33327; --tape:#c9a227; }
|
| 172 |
-
.gradio-container
|
|
|
|
|
|
|
|
|
|
| 173 |
background-image: radial-gradient(ellipse at 50% -10%, rgba(201,162,39,0.07) 0%, transparent 55%) !important; }
|
| 174 |
#ew-root { max-width: 900px; margin: 0 auto; }
|
| 175 |
.ew-header { text-align:center; color:var(--paper); letter-spacing:7px; font-size:34px; padding:12px 0 0;
|
|
|
|
| 169 |
CSS = """
|
| 170 |
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');
|
| 171 |
:root { --paper:#f4efe4; --ink:#2b2a28; --red:#a33327; --tape:#c9a227; }
|
| 172 |
+
.gradio-container, body, .dark, .light {
|
| 173 |
+
/* longhand wins the theme war: gradio light theme resets background-color */
|
| 174 |
+
background-color:#191713 !important;
|
| 175 |
+
font-family:'Courier New',monospace !important;
|
| 176 |
background-image: radial-gradient(ellipse at 50% -10%, rgba(201,162,39,0.07) 0%, transparent 55%) !important; }
|
| 177 |
#ew-root { max-width: 900px; margin: 0 auto; }
|
| 178 |
.ew-header { text-align:center; color:var(--paper); letter-spacing:7px; font-size:34px; padding:12px 0 0;
|
assets/case_bank.json
CHANGED
|
@@ -1,97 +1 @@
|
|
| 1 |
-
[
|
| 2 |
-
{
|
| 3 |
-
"name": "the <Pets> <Animal-Pet-Sharing-Comedy-Interview>",
|
| 4 |
-
"blurb": "<one sentence, third person>",
|
| 5 |
-
"seed": 1001
|
| 6 |
-
},
|
| 7 |
-
{
|
| 8 |
-
"name": "The <CYBER SECURITY <CYBERG AGENCY> <SECURITY PATTERNS> <COM",
|
| 9 |
-
"blurb": "In this fast-paced, high-stakes game, you'll tackle complex cybersecurity challenges using a range of specialized techniques, tools, and resources. Whether it's",
|
| 10 |
-
"seed": 1007
|
| 11 |
-
},
|
| 12 |
-
{
|
| 13 |
-
"name": "The <Food> <Cooking> <Cooking>",
|
| 14 |
-
"blurb": "The kitchen is full of delicious, mouth-watering recipes.",
|
| 15 |
-
"seed": 1008
|
| 16 |
-
},
|
| 17 |
-
{
|
| 18 |
-
"name": "the <Artistic> <Job/Heist/Affair/Caper>",
|
| 19 |
-
"blurb": "<one sentence, third person>",
|
| 20 |
-
"seed": 1013
|
| 21 |
-
},
|
| 22 |
-
{
|
| 23 |
-
"name": "the weather weather crime",
|
| 24 |
-
"blurb": "I was looking at this weather forecast and noticed that it was turning pretty rainy today. The game would be a simple one: I was trying to figure out if it was ",
|
| 25 |
-
"seed": 1014
|
| 26 |
-
},
|
| 27 |
-
{
|
| 28 |
-
"name": "the tech crime game",
|
| 29 |
-
"blurb": "A smart detective with a keen eye for the latest tech gadgets.",
|
| 30 |
-
"seed": 1015
|
| 31 |
-
},
|
| 32 |
-
{
|
| 33 |
-
"name": "The <Animal> <Animal> <Animal> <Animal> <Animal> <Animal> <A",
|
| 34 |
-
"blurb": "A humorous, family-friendly game about an animal detective who solves crimes, fights villains, and helps pets.",
|
| 35 |
-
"seed": 1017
|
| 36 |
-
},
|
| 37 |
-
{
|
| 38 |
-
"name": "The <Sword, Armor, Crown, Glove, Bow, Locket, Sword of Valor",
|
| 39 |
-
"blurb": "<one sentence, third person>",
|
| 40 |
-
"seed": 1019
|
| 41 |
-
},
|
| 42 |
-
{
|
| 43 |
-
"name": "the <sports> <Game> <Heist/Affair/Caper>",
|
| 44 |
-
"blurb": "<one sentence, third person>",
|
| 45 |
-
"seed": 1020
|
| 46 |
-
},
|
| 47 |
-
{
|
| 48 |
-
"name": "the <Mime <Art> <Comic Detective> <Funny>",
|
| 49 |
-
"blurb": "<one sentence, third person>",
|
| 50 |
-
"seed": 1021
|
| 51 |
-
},
|
| 52 |
-
{
|
| 53 |
-
"name": "the <Technology> <Job/Heist/Affair/Caper>",
|
| 54 |
-
"blurb": "<one sentence, third person>",
|
| 55 |
-
"seed": 1023
|
| 56 |
-
},
|
| 57 |
-
{
|
| 58 |
-
"name": "the <transportation> <Job/Heist/Affair/Caper>",
|
| 59 |
-
"blurb": "<one sentence, third person>",
|
| 60 |
-
"seed": 1027
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"name": "the <Scent> <Crime/Affair/Caper>",
|
| 64 |
-
"blurb": "<one sentence, third person>",
|
| 65 |
-
"seed": 1029
|
| 66 |
-
},
|
| 67 |
-
{
|
| 68 |
-
"name": "The Weather Game",
|
| 69 |
-
"blurb": "A hilarious game where you use weather reports to solve crimes.",
|
| 70 |
-
"seed": 1030
|
| 71 |
-
},
|
| 72 |
-
{
|
| 73 |
-
"name": "The <Music> <Job/Heist/Affair/Caper>",
|
| 74 |
-
"blurb": "In this game of musical crime, you'll navigate a world where genres collide and you'll uncover musical secrets hidden around corners. You'll need to use your mu",
|
| 75 |
-
"seed": 1034
|
| 76 |
-
},
|
| 77 |
-
{
|
| 78 |
-
"name": "the <FUNKY, FUNNY, FAMILY-FRIEND OFTEN-HOSTS, CO-CREATORS, A",
|
| 79 |
-
"blurb": "A hilarious, insightful, and action-packed game that turns ordinary players into the world's greatest comedy detective.",
|
| 80 |
-
"seed": 1036
|
| 81 |
-
},
|
| 82 |
-
{
|
| 83 |
-
"name": "the weather",
|
| 84 |
-
"blurb": "A comedic game where you use the current weather to solve crimes or catch runaway family members.",
|
| 85 |
-
"seed": 1038
|
| 86 |
-
},
|
| 87 |
-
{
|
| 88 |
-
"name": "the <Technology> <Job/Heist/Affair/Caper>",
|
| 89 |
-
"blurb": "<one sentence, third person>",
|
| 90 |
-
"seed": 1039
|
| 91 |
-
},
|
| 92 |
-
{
|
| 93 |
-
"name": "the <Song> <Genre>",
|
| 94 |
-
"blurb": "<one sentence, third person>",
|
| 95 |
-
"seed": 1042
|
| 96 |
-
}
|
| 97 |
-
]
|
|
|
|
| 1 |
+
[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|