Views
No views yet
qwen-2.5.
This was selected solely for technical compatibility (as Qwen 3 shares the same ChatML format), and does NOT indicate the use of the Qwen 2.5 base model.
The base model used is strictly Qwen3-4B-Instruct-2507.transformers.1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Note: The URL contains '2.5' due to initial template settings, but the model is Qwen3.
5model_id = "beachcities/Qwen2.5-3B-DPO-Final-Day3"
6
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 torch_dtype=torch.float16,
11 device_map="auto"
12)
13
14# Test inference
15prompt = "指示: 次の質問に論理的に答えてください。\\n質問: AIの未来についてどう思いますか?"
16messages = [{"role": "user", "content": prompt}]
17inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
18
19outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))