Downloads · 30 days
0
thesureshg/slm-rl-first-run-002
slm-rl-first-run-002 is a text generation model from thesureshg. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
PEFT LoRA adapter that warm-starts Space Invaders play for LiquidAI/LFM2.5-350M in the SLM-RL workshop.
Downloads · 30 days
0
Access
Public
Updated Jul 18, 2026
Repo size
24 MB
Likes
0
Public
Click a slice to open those files.
.safetensors24 MB · 100%
From the Hugging Face model README
PEFT LoRA adapter that warm-starts Space Invaders play for LiquidAI/LFM2.5-350M in the SLM-RL workshop.
| Game | space-invaders |
| Base model | LiquidAI/LFM2.5-350M |
| Adapter layout | adapter/ (PEFT adapter_config.json + weights) |
| Training | reject_sft on DQN teacher demos |
| Champion generation | 1 |
| Promoted | True (teacher warm-start adopted as RL initialization (not gated)) |
| Dataset pack | thesureshg/slm-rl-first-run-002-data |
Paste thesureshg/slm-rl-first-run-002 as the playground adapter URL (and usually the same id
as the dataset URL).
pip install "transformers>=4.46" peft accelerate torch
Weights live under the adapter/ subfolder — pass subfolder="adapter".
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE = "LiquidAI/LFM2.5-350M"
ADAPTER = "thesureshg/slm-rl-first-run-002" # this repo
device = (
"cuda" if torch.cuda.is_available()
else "mps" if torch.backends.mps.is_available()
else "cpu"
)
dtype = torch.bfloat16 if device != "cpu" else torch.float32
tokenizer = AutoTokenizer.from_pretrained(BASE)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=dtype)
model = PeftModel.from_pretrained(model, ADAPTER, subfolder="adapter")
model.to(device).eval()
messages = [
{"role": "system", "content": "You play Space Invaders. Reply with ACTION: <id>."},
{"role": "user", "content": "Legal actions: 1) NOOP 2) UP\nChoose."},
]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, tokenize=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=24, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
from huggingface_hub import snapshot_download
path = snapshot_download("thesureshg/slm-rl-first-run-002", allow_patterns="adapter/*")
# then: PeftModel.from_pretrained(base_model, f"{path}/adapter")
slm-rl evolve --game space-invaders \
--dataset-url thesureshg/slm-rl-first-run-002-data \
--adapter-url thesureshg/slm-rl-first-run-002 \
--generations 2
{
"eval": {
"episodes": 2,
"intervention_rate": 2.0,
"invalid_rate": 1.0,
"mean_entropy": null,
"mean_score": -1.3,
"primary": -1.3,
"win_rate": 0.0
},
"gate": {
"promoted": true,
"reason": "teacher warm-start adopted as RL initialization (not gated)"
},
"train": {
"entropy": 0.014028659394870583,
"loss": 0.0039739832282066345,
"mean_token_accuracy": 0.9965277772683364,
"num_pairs": 330
}
}
Trained with SLM-RL.