docs: add models used and sponsor prize categories to README
Mehdi
34dca80
docs: add demo video and LinkedIn post links to README
Mehdi
97c5c86
chore: update commit counter 68 → 101
Mehdi
fd28ec7
fix: pre-translate non-English chunks to English before LLM inference
Mehdi
67da08d
French PDFs caused the model to output French despite English-only
instructions — the source tokens dominated the decoding distribution.
Fix: detect French via stop-word heuristic, translate the chunk with
a dedicated LLM call (cached per chunk), then use the English version
for question generation, MCQ and evaluation.
Also strip leading number prefixes (e.g. '3. ') from section bodies
in the JS feedback parser so mis-numbered model output renders cleanly.
fix: enable sampling — temperature=0.8 for MCQ, 0.4 for evaluator
Mehdi
8f2e039
Greedy decoding (do_sample=False) caused the model to repeat the same
answer for all 4 MCQ options (e.g. 4x BERT) and to copy source text
verbatim for the model answer. Sampling breaks the repetition loop and
produces diverse, coherent outputs.
fix: stronger MCQ/evaluator prompts — no duplicates, no self-reference, English-only, section 2 always present
Mehdi
c8e8b73
- MCQ: explicit rule against self-referential questions and duplicate options
- MCQ: retry loop (up to 3x) validates all 4 choices are unique before returning
- Evaluator: section 2 (What was good) is MANDATORY even for wrong/empty answers
- Evaluator: section 4 must synthesize answer in own words, not copy source text
- Both: stronger English-only enforcement with explicit "translate everything" instruction
fix: restore MiniCPM4-8B in hackathon narrative, fix fine-tune duration claim
Mehdi
48d282a
feat: 6/6 badges — unlock Sharing is Caring, add Chapter 06 on MiniCPM4.1-8B upgrade
Mehdi
9e029e8
chore: update blog to MiniCPM4.1-8B fine-tune + Sharing is Caring badge earned
Mehdi
757dfee
feat: add share_trace.py — run session + push agent trace to HF Hub dataset
Mehdi
3f8b85e
feat: retarget fine-tune pipeline to MiniCPM4.1-8B
Mehdi
f5c39d2
- train_modal.py: BASE_MODEL → openbmb/MiniCPM4.1-8B
HUB_REPO → build-small-hackathon/MiniCPM4.1-8B-PaperProf
enable_thinking=False in apply_chat_template
- convert_gguf_modal.py: SRC/GGUF repos updated to 4.1 names
- model/llm.py: DEFAULT_MODEL_ID and GGUF_REPO point to new fine-tune repos
feat: upgrade to MiniCPM4.1-8B + official GGUF, disable thinking mode
Mehdi
5ad43b3
- DEFAULT_MODEL_ID → openbmb/MiniCPM4.1-8B
- DEFAULT_GGUF_REPO → openbmb/MiniCPM4.1-8B-GGUF
- enable_thinking=False in apply_chat_template to suppress chain-of-thought
tokens and keep structured question/evaluation outputs clean
- transformers==4.57.1 satisfies the new >=4.56 requirement, no pin change needed
revert: restore original demo.launch(), blog served from separate static Space
Mehdi
7458c71
fix: inject /blog into Gradio's internal FastAPI router at position 0
Mehdi
2d50118
gr.mount_gradio_app + uvicorn was ignored by HF Spaces (expects demo.launch).
Use prevent_thread_lock=True to get the live FastAPI app, then insert the
static-files Mount at index 0 so it is checked before Gradio's catch-all.
fix: mount /blog before Gradio so static files aren't swallowed by catch-all route
Mehdi
008db30
feat: serve blog at /blog from main Space + badge showcase
Mehdi
fffdc96
- Mount blog/ as FastAPI static files at /blog so the blog lives on
the same Space as the app (no separate repo needed)
- Add badges section to blog/index.html: 5 earned, 1 locked
- Add badges table to BLOG.md
feat: full-height libraries, pre-generated reward image, English upload text
fix: make the llama.cpp CPU runtime actually usable on the Space
Mehdi
b5f4a07
- No @spaces.GPU window for llamacpp (CPU-only, was wasting quota and
capping calls at 180s)
- Preload the GGUF into RAM at startup in a background thread
- JS: pick up late results even after the spinner times out, timeout
raised to 5 min with honest CPU-mode messages, guarded by mode
- Evaluation capped at 320 tokens to fit CPU latency
feat: grounded, varied training explanations for MCQ and evaluation
Mehdi
f6ad483
MCQ explanations and evaluation feedback now quote the supporting
sentence from the source text with varied phrasing, instead of one
generic template the model learned to parrot.
fix: custom collator so EOS is learned (pad==eos masked stop tokens in v2)
Mehdi
1d99c93
fix: truncate runaway question generation to the first question
Mehdi
81e2542
The v2 fine-tune never learned EOS (pad==eos masked the stop token in
training labels), so open questions rambled into endless Q/A streams.
Clean the output to the first '?' and cap generation at 80 tokens.
fix: multi-task fine-tuning — single-task training broke MCQ format
Mehdi
bafdec2
Train on all three production formats: question gen (SQuAD, 1500),
MCQ with distractors (SciQ, 1200), structured evaluation (SQuAD-derived,
800). The narrow question-only fine-tune made the model ignore the
QUESTION:/A)/CORRECT: structure, returning empty MCQs.
fix: prebuilt CPU wheel for llama-cpp-python, skip 15min source compile on Spaces
Mehdi
32c8c58
feat: llama.cpp runtime ready for the Space (Llama Champion)
Mehdi
a474fe5
- llama-cpp-python in requirements
- LlamaCppLLM defaults to CPU on ZeroGPU Spaces (CUDA context does not
survive between @spaces.GPU windows), overridable via
PAPERPROF_GGUF_GPU_LAYERS
- GGUF conversion job disk fix (512 GiB Modal minimum)
fix: verify Hub write access before training, fallback to user namespace
Mehdi
5fa3ac9
feat: switch to our fine-tuned MiniCPM4-8B-PaperProf model (Well-Tuned)
Mehdi
2c3748a
QLoRA fine-tune published at build-small-hackathon/MiniCPM4-8B-PaperProf,
trained on 3000 SQuAD pairs formatted with the production prompt.
feat: Well-Tuned + Llama Champion groundwork
Mehdi
8087133
- finetune/train_modal.py: QLoRA fine-tune of MiniCPM4-8B on SQuAD pairs
formatted with the production prompt, merged and pushed to the Hub
- finetune/convert_gguf_modal.py: GGUF f16 + Q4_K_M conversion of the
fine-tuned model, pushed to a -GGUF repo
- model/llm.py: llama.cpp runtime backend (LlamaCppLLM) selected via
PAPERPROF_RUNTIME=llamacpp, transformers stays the default
move: team section to Chapter 01, right after the intro
Mehdi
7a3f6e0
feat: team section on the blog with Ryad Gazenay and Mehdi Azouz, GitHub and LinkedIn links, optimized photos
Mehdi
e70cc5e
fix: library panels full width, hidden rows off-screen
redesign: blog as a crafted dev site, no emoji, heavier animations
Mehdi
8f44476
Space Grotesk display type, scramble-decode on the title, staggered
line reveals, live-typing git log terminal, 3D tilt cards with glare,
marquee strip, ghost chapter numerals, magnetic CTA button, custom
cursor with trailing ring, conic-gradient border animation. All gated
behind prefers-reduced-motion and pointer:fine.
feat: full-height library side panels with animated robots
docs: Field Notes blog post — what we built and what we learned
Mehdi
dc3b7d4
Covers the full journey: MiniCPM4-8B on ZeroGPU, the Off-Brand
hidden-Gradio bridge (height:0, textbox triggers, polling), FLUX.2-klein
prefetching, client-side MCQ grading, and the double-handler bug.
feat: amphitheater hero with mouse-tracking robot professor, fixed particles
btn.onclick in showMCQ is reliable (set fresh per question).
The addEventListener in wireButtons had timing issues with the _pp guard.
Keep mcqAnswered guard to prevent any double-count.
fix: MCQ double-count — remove duplicate onclick handler in showMCQ
Mehdi
ff2dbd5
wireButtons() already registers addEventListener on MCQ buttons (once,
guarded by _pp). showMCQ() was also setting btn.onclick, causing
handleMCQAnswer to fire twice per click and push two history entries.
Remove the onclick assignment and add mcqAnswered guard for safety.
fix: force English output in all LLM prompts regardless of PDF language
Mehdi
490c5f1
Questions, MCQ options, explanations and feedback are now always
generated in English even when the source PDF is in French or another language.
feat: FLUX image generation moved to End Session modal as session visual summary