Views
No views yet
| Base Model | Our Trained Model | Link |
|---|---|---|
| DeepSeek-R1-Distill-Qwen-7B | S3-CoT-DeepSeek-R1-Distill-Qwen-7B_v2 | https://huggingface.co/yrdu/S3-CoT-DeepSeek-R1-Distill-Qwen-7B_v2 |
| DeepSeek-R1-Distill-Qwen-7B | S3-CoT-DeepSeek-R1-Distill-Qwen-7B | https://huggingface.co/yrdu/S3-CoT-DeepSeek-R1-Distill-Qwen-7B |
| Qwen2.5-7B-Instruct | S3-CoT-Qwen2.5-7B-Instruct | https://huggingface.co/yrdu/S3-CoT-Qwen2.5-7B-Instruct |
| Llama-3.1-8B-Instruct | S3-CoT-Llama-3.1-8B-Instruct | https://huggingface.co/yrdu/S3-CoT-Llama-3.1-8B-Instruct |
| Qwen3-4B-Thinking-2507 | S3-CoT-Qwen3-4B-Thinking-2507 | https://huggingface.co/yrdu/S3-CoT-Qwen3-4B-Thinking-2507 |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3system1_template = " Please provide as a brief reasoning process as possible, and put your final answer within \\boxed{}"
4system2_template = " Please reason step by step, and put your final answer within \\boxed{}"
5
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 device_map="auto",
10 torch_dtype="bfloat16",
11)
12generation_config={"xxx"}
13prompt = "xxx"
14
15messages = [
16 {"role": "user", "content": prompt+system1_template}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True
22)
23
24model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
25generated_ids = model.generate(
26 **model_inputs,
27 **generation_config,
28)
29
30output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
31output_content = tokenizer.decode(output_ids, skip_special_tokens=True)