Views
No views yet
Qwen/Qwen2.5-1.5B-Instruct<think> and <answer>).unsloth, trl, vllm<think> for reasoning steps and <answer> for the final output.
2. Correctness Reward: Evaluates the final extracted output against deterministic unit tests (exact match).transformers library:1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "Satyamp777/Qwen-GRPO-Agent"
4
5# Load the tokenizer and model
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
8
9# Format your prompt
10prompt = "If I have 5 apples and buy 3 more, how many do I have? Think step-by-step."
11messages = [
12 {"role": "system", "content": "You are a helpful AI reasoning agent. Put all your thinking inside <think> </think> tags. Put your final answer inside <answer> </answer> tags."},
13 {"role": "user", "content": prompt}
14]
15
16# Generate the response
17inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
18outputs = model.generate(inputs, max_new_tokens=256)
19print(tokenizer.decode(outputs[0]))