Views
No views yet
<start_working_out>
[Step-by-step reasoning]
<end_working_out>
<SOLUTION>[Answer]</SOLUTION>1from unsloth import FastModel
2
3model, tokenizer = FastModel.from_pretrained(
4 model_name="colesmcintosh/mellow-gemma-3-reasoning",
5 max_seq_length=16000,
6)
7
8system_prompt = """You are given a problem.
9Think about the problem and provide your working out.
10Place it between <start_working_out> and <end_working_out>.
11Then, provide your solution between <SOLUTION></SOLUTION>"""
12
13messages = [
14 {"role": "system", "content": system_prompt},
15 {"role": "user", "content": "If 5 apples cost $10, how much do 8 apples cost?"}
16]
17
18text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
19outputs = model.generate(**tokenizer(text, return_tensors="pt").to("cuda"), max_new_tokens=256)