Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "OpenLearnLM/special-r1-qwen2.5-7b-nothink"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype="auto",
9 device_map="auto"
10)
11
12messages = [
13 {"role": "user", "content": "What is the capital of France?"}
14]
15
16text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
17inputs = tokenizer(text, return_tensors="pt").to(model.device)
18
19outputs = model.generate(**inputs, max_new_tokens=512)
20response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
21print(response)| Model | Description |
|---|---|
| special-r1-qwen2.5-7b-nothink (this) | Direct answers without explicit reasoning |
| special-r1-qwen2.5-7b-think | With chain-of-thought reasoning |
1@misc{openlearnlm2025special,
2 title={Special-R1: Reasoning Models for Education},
3 author={OpenLearnLM Team},
4 year={2025},
5 publisher={HuggingFace},
6 url={https://huggingface.co/OpenLearnLM/special-r1-qwen2.5-7b-nothink}
7}