Downloads · 30 days
24
17% of all-time downloads
nazdef/gemma-3-1b-it-ghigliottina-grpo-merged-ckpt564
gemma-3-1b-it-ghigliottina-grpo-merged-ckpt564 is a text generation model from nazdef. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
Modello merged (base + LoRA) per task stile Ghigliottina in italiano.
Downloads · 30 days
24
17% of all-time downloads
All-time downloads
142
Public
Parameters
1000M
4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4 GB · 99%
From the Hugging Face model README
Modello merged (base + LoRA) per task stile Ghigliottina in italiano.
Questo repository HF contiene il risultato del merge di:
google/gemma-3-1b-itoutputs/gemma-3-1b-grpo-train-v2-3ep/checkpoint-564peft.PeftModel.merge_and_unload()Il risultato è un modello standalone (model.safetensors) caricabile direttamente con transformers senza dover applicare un adapter separato.
Nel progetto locale python_project/grpo-training è stata eseguita questa pipeline GRPO:
Dataset preparation
data_prep.py)Prompting setup
<think>...</think>soluzione: <parola>.Training GRPO su Gemma 3 1B IT
google/gemma-3-1b-itMonitoring & eval
Publishing (questo repo)
checkpoint-564) con merge_and_unloadScript principali usati:
train_grpo.pyreward_functions.pyeval_accuracy.pyplot_rewards.pymerge_and_push_hf.pyComando usato per il merge + publish:
python merge_and_push_hf.py \
--adapter-path ./outputs/gemma-3-1b-grpo-train-v2-3ep/checkpoint-564 \
--out-dir ./outputs/merged_test_checkpoint564 \
--hub-repo descansodj/gemma-3-1b-it-ghigliottina-grpo-merged-ckpt564 \
--push \
--device cpu
Il training era orientato a questo formato:
<think>
...
</think>
soluzione: <parola>.
Input user tipico (bullet-only):
- gatto
- amico
- compagnia
- pelo
- caccia
Nota: essendo un checkpoint intermedio mergiato, il modello può ancora produrre output non perfettamente strict.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
repo_id = "descansodj/gemma-3-1b-it-ghigliottina-grpo-merged-ckpt564"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
torch_dtype=torch.float16,
device_map="auto",
)
system_prompt = '''Sei un assistente che risolve il gioco della Ghigliottina, in cui bisogna trovare la “parola comune”.
Ti verranno fornite 5 parole-indizio: devi trovare UNA sola parola che è collegata a tutte le 5 parole-indizio.
Regole di output (obbligatorie):
1) Prima ragiona a lungo nei tag:
<think>
...
</think>
2) Nel ragionamento valuta più ipotesi di soluzione e scarta quelle deboli.
3) Dopo </think> scrivi esattamente: "soluzione: <parola>.\n" (in minuscolo, senza punteggiatura nella parola).
4) La parola soluzione deve essere diversa da tutti gli indizi forniti.
5) Non aggiungere testo dopo la parola finale.
Esempio SOLO di formato (non del contenuto):
"""
<think>
valuto più ipotesi di soluzione e scarto quelle deboli...
</think>
soluzione: <parola>.
"""
'''
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "\n- gatto\n- amico\n- compagnia\n- pelo\n- caccia"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=64,
num_beams=1,
max_new_tokens=256,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
)
completion = tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(completion)
exact_match non ancora alto al checkpoint usato.strict_format non sempre rispettato.python_project/grpo-trainingcheckpoint-564Se vuoi una release più stabile, conviene pubblicare anche il merge da adapter finale e confrontare i due repo HF.