Views
No views yet
Format note: this is an MLX model (converted base:mlx-community/gemma-3-4b-it-bf16). It loads withmlx_lmon Apple Silicon. It is not atransformers/PyTorch checkpoint. The repo also ships the LoRA adapter underadapter/for applying on top of the base yourself.
1from mlx_lm import load, generate
2
3model, tok = load("miguelconner4/claro")
4
5SYSTEM = ("Rewrite the user's text in CEFR A2 (Elementary English): short simple "
6 "sentences, basic vocabulary, no idioms. Keep all important facts. "
7 "Output only the rewritten text.")
8
9complex_text = "The edifice, constructed circa 1750, was subsequently designated a historic landmark."
10prompt = tok.apply_chat_template(
11 [{"role": "system", "content": SYSTEM},
12 {"role": "user", "content": complex_text}],
13 tokenize=False, add_generation_prompt=True,
14)
15print(generate(model, tok, prompt=prompt, max_tokens=512, verbose=False))
16# -> "The building was built around 1750. People decided it was important history."reward = level_band × vocab × fidelity × format_gates (each ∈ [0,1]).level_band — deterministic A2 difficulty: readability (Flesch), mean sentence
length, passive and subordination density, with bands calibrated to the
10th–90th percentiles of real A2 reference texts.vocab — penalty for off-A2-list words, with gloss-aware exemption (defining a
hard term in-line is not penalized).fidelity — LLM judge, decomposed into fact-level recall + hallucination
counts (not a holistic score).format_gates — hard pass/fail for markdown / degenerate loops.