Views
No views yet
<STATS> block and produce a Spanish-language
crónica in one of 8 regional commentator styles.<cronica>...</cronica> span; prompt tokens contribute zero loss.1import jax
2from tokenizers import Tokenizer
3from cronica.train import load_ckpt
4from cronica.sample import generate_cronica
5from huggingface_hub import hf_hub_download
6
7tok_path = hf_hub_download("DanielRegaladoCardoso/cronica-jax-5m", "tokenizer.json")
8ckpt = hf_hub_download("DanielRegaladoCardoso/cronica-jax-5m", "ckpt_002000.pkl")
9
10tok = Tokenizer.from_file(tok_path)
11params, cfg, step = load_ckpt(ckpt)
12
13stats = ("<STATS>\n"
14 "liga: La Liga\n"
15 "fecha: 2024-03-15\n"
16 "local: Real Madrid\n"
17 "visitante: Atletico Madrid\n"
18 "resultado: 2-1\n"
19 "goles:\n"
20 " - 23' Vinicius Junior (Real Madrid)\n"
21 " - 67' Antoine Griezmann (Atletico Madrid)\n"
22 " - 88' Jude Bellingham (Real Madrid)\n"
23 "</STATS>")
24
25text = generate_cronica(params, cfg, tok, stats,
26 style_label="rioplatense_apasionado",
27 temperature=0.85, top_k=50, top_p=0.9,
28 max_new_tokens=300)
29print(text)| label | region / flavor |
|---|---|
rioplatense_apasionado | Argentina, emotive, "gol" lengthened |
rioplatense_tecnico | Argentina, analytical |
rioplatense_literario | Uruguay, evocative prose |
mexicano_irreverente | Mexico, sarcastic |
mexicano_clasico | Mexico, formal |
centroamericano_espn | El Salvador / ESPN Latam, polished |
espanol_radiofonico | Spain, radio broadcast style |
comentario_tecnico | tactical analysis |
gpt-4o-mini,
which sometimes added manager names, stadium nicknames, or derby
references not present in the <STATS>. Our small model can reproduce
this hallucination tendency. Use with care if grounding matters.rioplatense_apasionado,
rioplatense_literario, comentario_tecnico) have strong distinctive
vocab (gooool, barrilete, transiciones); the other five share
more neutral journalistic vocabulary.