Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "ertghiu256/Qwen3-4b-tcomanr-merge-v2.3"
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 = "Give me a short introduction to large language model."
15messages = [
16 {"role": "user", "content": prompt}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True,
22)
23model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
24
25# conduct text completion
26generated_ids = model.generate(
27 **model_inputs,
28 max_new_tokens=32768
29)
30output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
31
32# parsing thinking content
33try:
34 # rindex finding 151668 (</think>)
35 index = len(output_ids) - output_ids[::-1].index(151668)
36except ValueError:
37 index = 0
38
39thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
40content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
41
42print("thinking content:", thinking_content) # no opening <think> tag
43print("content:", content)vllm serve ertghiu256/Qwen3-4b-tcomanr-merge-v2.3 --enable-reasoning --reasoning-parser deepseek_r1python -m sglang.launch_server --model-path ertghiu256/Qwen3-4b-tcomanr-merge-v2.3 --reasoning-parser deepseek-r1llama-server --hf-repo ertghiu256/Qwen3-4b-tcomanr-merge-v2.3llama-cli --hf ertghiu256/Qwen3-4b-tcomanr-merge-v2.3ollama run ertghiu256/Qwen3-4b-tcomanr-merge-v2.3:Q8_0ollama run ertghiu256/Qwen3-4b-tcomanr-merge-v2.3:Q5_K_Mollama run ertghiu256/Qwen3-4b-tcomanr-merge-v2.3:IQ4_NLertghiu256/Qwen3-4b-tcomanr-merge-v2.3temp: 0.6
num_ctx: ≥8192
top_p: 0.95
top_k: 10
Repeat Penalty: 1.11models:
2 - model: ertghiu256/qwen3-math-reasoner
3 parameters:
4 weight: 0.8
5 - model: ertghiu256/qwen3-4b-code-reasoning
6 parameters:
7 weight: 0.9
8 - model: ertghiu256/qwen-3-4b-mixture-of-thought
9 parameters:
10 weight: 1.0
11 - model: POLARIS-Project/Polaris-4B-Preview
12 parameters:
13 weight: 0.8
14 - model: ertghiu256/qwen3-multi-reasoner
15 parameters:
16 weight: 0.9
17 - model: ertghiu256/Qwen3-Hermes-4b
18 parameters:
19 weight: 0.7
20 - model: ValiantLabs/Qwen3-4B-Esper3
21 parameters:
22 weight: 0.75
23 - model: Tesslate/UIGEN-T3-4B-Preview-MAX
24 parameters:
25 weight: 1.0
26 - model: ValiantLabs/Qwen3-4B-ShiningValiant3
27 parameters:
28 weight: 0.6
29 density: 0.5
30 - model: huihui-ai/Huihui-Qwen3-4B-Thinking-2507-abliterated
31 parameters:
32 weight: 0.75
33 - model: Qwen/Qwen3-4B-Thinking-2507
34 parameters:
35 weight: 1.0
36 - model: Qwen/Qwen3-4b-Instruct-2507
37 parameters:
38 weight: 0.75
39 - model: GetSoloTech/Qwen3-Code-Reasoning-4B
40 parameters:
41 weight: 0.75
42 density: 0.55
43 - model: ertghiu256/Qwen3-4B-Thinking-2507-Hermes-3
44 parameters:
45 weight: 1.0
46 - model: janhq/Jan-v1-4B
47 parameters:
48 weight: 0.3
49merge_method: ties
50base_model: Qwen/Qwen3-4B-Thinking-2507
51parameters:
52 normalize: true
53 int8_mask: true
54 lambda: 1.0
55dtype: float16