AndrewRqy commited on
Commit ยท
f669e5b
1
Parent(s): 555c51c
README: demo video link, loading-time note, lean/full guidance, point to apprentice field notes
Browse files
README.md
CHANGED
|
@@ -32,73 +32,76 @@ models:
|
|
| 32 |
|
| 33 |
# The Apprentice โ Build Small Hackathon
|
| 34 |
|
| 35 |
-
> A pixel-art branching fairy-tale
|
| 36 |
|
| 37 |
-
**Track**: Thousand Token Wood
|
| 38 |
-
**Stack**: Gradio + Modal-hosted vLLM + Qwen2.5-14B + custom humor LoRA
|
| 39 |
-
**Languages**: English +
|
| 40 |
-
**Demo video**:
|
| 41 |
-
**Social post**: _(to be added by submitter)_
|
|
|
|
| 42 |
|
| 43 |
-
--
|
| 44 |
|
| 45 |
-
## What's
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
| **6 themes ร 2 languages** | Fantasy, Space-Cowboy, Galactic-Light, Black-Land, Mistgate, Quiet-Years โ each with its own sprite set, finale boss, themed obstacle scenes (finale / arena / passage / trap), localized banner + oracle artifact + apprentice role title. All authored for both English and Chinese. |
|
| 54 |
-
| **Klein-4B sprites** | All in-game art (~105 pixel-art sprites + 4 environment backdrops per theme) was generated locally via Klein-4B on a Modal H100, then chroma-keyed offline. No FLUX, no commercial generators. |
|
| 55 |
|
| 56 |
## How to play
|
| 57 |
|
| 58 |
-
1. **Inscribe** โ pick a language,
|
| 59 |
-
2. **Send-off** โ the mentor seals the parchments
|
| 60 |
-
3. **Five trials** โ at each obstacle, the apprentice draws ONE oracle. The model takes the obstacle +
|
| 61 |
-
4. **Boss** โ trial 5 is the world's finale (
|
| 62 |
-
5. **Ending** โ one of 5 distinct endings plays, each with
|
| 63 |
-
6. **Summary** โ
|
| 64 |
|
| 65 |
## Badge claims
|
| 66 |
|
| 67 |
| Badge | Why we claim it |
|
| 68 |
|---|---|
|
| 69 |
-
|
|
| 70 |
-
|
|
| 71 |
-
|
|
| 72 |
-
|
|
| 73 |
|
| 74 |
-
## Running it
|
| 75 |
|
| 76 |
-
Three environment variables
|
| 77 |
|
| 78 |
```
|
| 79 |
-
MODAL_URL = https://<
|
| 80 |
MODAL_KEY = wk-โฆ (Modal proxy auth key)
|
| 81 |
MODAL_SECRET = ws-โฆ (Modal proxy auth secret)
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
If `MODAL_URL` is unset OR `ORACLES_FORCE_MOCK=1`, the app runs in **mock mode** โ
|
| 87 |
|
| 88 |
-
##
|
| 89 |
|
| 90 |
```
|
| 91 |
oracles_app/
|
| 92 |
-
โโโ app.py
|
| 93 |
-
โโโ
|
| 94 |
-
โโโ requirements.txt
|
| 95 |
-
โโโ
|
| 96 |
-
โโโ
|
| 97 |
-
|
| 98 |
-
โโโ assets/sprites/ ~105 chroma-keyed pixel-art PNGs
|
| 99 |
```
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
## Credits
|
| 104 |
|
|
|
|
| 32 |
|
| 33 |
# The Apprentice โ Build Small Hackathon
|
| 34 |
|
| 35 |
+
> A pixel-art branching fairy-tale. You inscribe five short oracles before the journey begins; an apprentice has to make every one of them save his life across five trials in a tree that converges on one of five distinct endings.
|
| 36 |
|
| 37 |
+
- **Track**: Thousand Token Wood
|
| 38 |
+
- **Stack**: Docker + Gradio + Modal-hosted vLLM + Qwen2.5-14B + custom humor LoRA
|
| 39 |
+
- **Languages**: English + ็ฎไฝไธญๆ
|
| 40 |
+
- **Demo video**: https://youtu.be/Ica9BgX5ZDk
|
| 41 |
+
- **Social post**: _(to be added by submitter)_
|
| 42 |
+
- **Field notes**: [`docs/FIELD_NOTES_apprentice.md`](../docs/FIELD_NOTES_apprentice.md)
|
| 43 |
|
| 44 |
+
> **โฑ Note on loading time**: this Space ships ~100 pixel-art sprites + theme backdrops. HF Space's free CPU tier has slow egress bandwidth, so first paint of a fresh container can take a minute or two; subsequent page transitions are faster as the browser caches assets. The front-page dropdown lets you flip between **Lean** (small payload, fast loading, default on the Space) and **Full** (parallax banner, scene landscapes, all decorative PNGs โ recommended only on a fast connection or once the Space is warm).
|
| 45 |
|
| 46 |
+
## What's inside
|
| 47 |
|
| 48 |
+
- **Frontend** โ Single-file Gradio app with a hand-authored pixel-art aesthetic. Press Start 2P + VT323 fonts, NES-style sharp corners, custom theme suppressing all default Gradio chrome.
|
| 49 |
+
- **Backend** โ Qwen2.5-14B + custom humor LoRA (`AndrewRqy/oracles-wizard-14b-lora`) served via vLLM on Modal. Frontend talks to it through the OpenAI SDK.
|
| 50 |
+
- **Tiny Titan path** โ Same 23k humor corpus trained into a Qwen2.5-1.5B LoRA (`AndrewRqy/oracles-wizard-1.5b-lora`). Eligible for the โค4B prize.
|
| 51 |
+
- **Branching narrative** โ Hand-authored 15-node story tree with 5 endings. Each fork at trials 2โ4 is decided by an LLM call seeded with one of the player's oracles, so the path the apprentice walks is shaped by what was inscribed.
|
| 52 |
+
- **6 themes ร 2 languages** โ Fantasy, Space-Cowboy, Galactic-Light, Black-Land, Mistgate, Quiet-Years. Theme-neutral story nodes + per-theme vocabulary expansion at runtime.
|
| 53 |
+
- **All art generated locally** โ ~105 pixel-art sprites via Klein-4B on a Modal H100, chroma-keyed offline. No FLUX, no commercial generators.
|
|
|
|
|
|
|
| 54 |
|
| 55 |
## How to play
|
| 56 |
|
| 57 |
+
1. **Inscribe** โ pick a language, theme, visual mode, and narration length. Then write five short oracles. Any words; gibberish counts, emoji counts.
|
| 58 |
+
2. **Send-off** โ the mentor seals the parchments. The apprentice leaves.
|
| 59 |
+
3. **Five trials** โ at each obstacle, the apprentice draws ONE oracle. The model takes the obstacle + oracle and writes a ~200-word resolution in one of three humor modes (wild imagination / accidental trip / last-minute revelation).
|
| 60 |
+
4. **Boss** โ trial 5 is the world's finale (dragon, warlord-king, etc.). Different paths through the tree lead to different bosses.
|
| 61 |
+
5. **Ending** โ one of 5 distinct endings plays, each with a hand-authored framing (why the boss behaved as it did + what the apprentice carried home), expanded by the LLM into a 3-paragraph epilogue.
|
| 62 |
+
6. **Summary** โ the story tree shows the path you walked lit gold; the four endings you didn't reach blur behind "???" for replay.
|
| 63 |
|
| 64 |
## Badge claims
|
| 65 |
|
| 66 |
| Badge | Why we claim it |
|
| 67 |
|---|---|
|
| 68 |
+
| ๐ฏ **Well-Tuned** | Qwen2.5-14B + a hand-distilled 23k-example humor LoRA (rank 16, ~6.5h on H100). Visibly steers all three humor modes; details in field notes. |
|
| 69 |
+
| ๐จ **Off-Brand** | ~2000 lines of bespoke CSS, Press Start 2P + VT323 fonts, hand-painted pixel-art sprites, custom story-tree visualization, custom ending banner. No stock Gradio chrome reaches the page. |
|
| 70 |
+
| ๐ **Field Notes** | [`docs/FIELD_NOTES_apprentice.md`](../docs/FIELD_NOTES_apprentice.md) โ a build diary covering what we designed and what broke. |
|
| 71 |
+
| โก **Tiny Titan** | Same 23k corpus trained into a Qwen2.5-1.5B LoRA (~$5.50, ~1.5h on H100). Eligible for the โค4B prize. |
|
| 72 |
|
| 73 |
+
## Running it
|
| 74 |
|
| 75 |
+
Three environment variables go in HF Space โ **Settings โ Variables and secrets** (or `.env.local` for local runs):
|
| 76 |
|
| 77 |
```
|
| 78 |
+
MODAL_URL = https://<workspace>--<app>-serve.modal.run
|
| 79 |
MODAL_KEY = wk-โฆ (Modal proxy auth key)
|
| 80 |
MODAL_SECRET = ws-โฆ (Modal proxy auth secret)
|
| 81 |
```
|
| 82 |
|
| 83 |
+
Locally:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
./run.sh # lean mode, default
|
| 87 |
+
./run.sh --full # all visual assets enabled (recommended on fast connections)
|
| 88 |
+
```
|
| 89 |
|
| 90 |
+
If `MODAL_URL` is unset OR `ORACLES_FORCE_MOCK=1`, the app runs in **mock mode** โ the UI still works, but narrations are hand-written placeholders.
|
| 91 |
|
| 92 |
+
## Repo layout
|
| 93 |
|
| 94 |
```
|
| 95 |
oracles_app/
|
| 96 |
+
โโโ app.py # main Gradio file
|
| 97 |
+
โโโ Dockerfile # HF Space Docker SDK entry
|
| 98 |
+
โโโ requirements.txt
|
| 99 |
+
โโโ oracles/ # state, LLM client, story graph, themes, i18n
|
| 100 |
+
โโโ prompts/ # LLM prompt templates
|
| 101 |
+
โโโ assets/sprites/ # ~105 chroma-keyed pixel-art PNGs
|
|
|
|
| 102 |
```
|
| 103 |
|
| 104 |
+
Dev-only dirs (`modal_backend/`, `scripts/`, `training/`, `tests/`, `lora-out/`) live on local disk but are `.gitignore`d from the Space upload.
|
| 105 |
|
| 106 |
## Credits
|
| 107 |
|