Views
No views yet

| prompt | chosen | rejected |
|---|---|---|
| "가장자리에 있는 저 물건은 뭐야?" | "가에 있는 저 물건은 뭐야?" / "모퉁이에 있는 저 물건은 뭐야?" | "한가운데에 있는 저 물건은 뭐야?" |
| "가냘프다는 건 얇다는 거야 약하다는 거야?" | "가냘프다는 건 연약하다는 의미야" | "튼튼하다는 건 얇다는 거야 강하다는 거야?" |
| "사과를 쪼개어 줄래?" | "사과를 갈라줄래?" / "사과를 나누어 줄래?" | "사과를 통째로 줄래?" |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "NEXTITS/QUANTUS-L-SLM-2509-v0.9.1"
4
5# load the tokenizer and the model
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype="auto",
10 device_map="auto"
11)
12
13# prepare the model input
14prompt = "이 햄버거는 존맛탱이야"
15messages = [
16 {"role": "user", "content": prompt}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True,
22 enable_thinking=False # Switches between thinking and non-thinking modes. Default is True.
23)
24model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
25
26# conduct text completion
27generated_ids = model.generate(
28 **model_inputs,
29 max_new_tokens=128,
30 temperature=0.2,
31)
32output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
33
34# parsing thinking content
35try:
36 # rindex finding 151668 (</think>)
37 index = len(output_ids) - output_ids[::-1].index(151668)
38except ValueError:
39 index = 0
40
41thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
42content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
43
44print("thinking content:", thinking_content)
45print("content:", content)
46@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
eprint={2505.09388},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.09388},
}