from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
model = PeftModel.from_pretrained(base, "tksluangrath/lol-matchbook")
messages = [
{"role": "system", "content": "You are a League of Legends coach. Give concise, rank-aware matchup advice for the game phase asked about. If you do not have reliable data for this matchup at this rank, say so plainly instead of inventing specifics."},
{"role": "user", "content": "How does Camille beat Urgot in the early game?"},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(inputs, max_new_tokens=256)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))