Trilogix1 commited on
Commit
9fec6eb
·
verified ·
1 Parent(s): 84cb6b3

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +168 -0
README.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ license_link: https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct/blob/main/LICENSE
5
+ convertor link: https.//hugston.com/software
6
+ pipeline_tag: text-code-generation
7
+ ---
8
+
9
+ # Hugston-Qwen3-Coder-30B-A3B-Instruct
10
+ <a href="https://chat.qwen.ai/" target="_blank" style="margin: 2px;">
11
+ <img alt="Chat" src="https://img.shields.io/badge/%F0%9F%92%9C%EF%B8%8F%20Qwen%20Chat%20-536af5" style="display: inline-block; vertical-align: middle;"/>
12
+ </a>
13
+
14
+ ## Highlights
15
+
16
+ **Hugston-Qwen3-Coder** is available in multiple sizes. Today, we're excited to introduce **Hugston-Qwen3-Coder-30B-A3B-Instruct**. This streamlined model maintains impressive performance and efficiency, featuring the following key enhancements:
17
+
18
+ - **Significant Performance** among open models on **Agentic Coding**, **Agentic Browser-Use**, and other foundational coding tasks.
19
+ - **Long-context Capabilities** with native support for **256K** tokens, extendable up to **1M** tokens using Yarn, optimized for repository-scale understanding.
20
+ - **Agentic Coding** supporting for most platform such as **Qwen Code**, **HugstonOne**, featuring a specially designed function call format.
21
+
22
+ ![image/jpeg](https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-Coder/qwen3-coder-30a3-main.jpg)
23
+
24
+ ## Model Overview
25
+
26
+ **Hugston-Qwen3-Coder-30B-A3B-Instruct** has the following features:
27
+ - Type: Causal Language Models
28
+ - Training Stage: Pretraining & Post-training
29
+ - Number of Parameters: 30.5B in total and 3.3B activated
30
+ - Number of Layers: 48
31
+ - Number of Attention Heads (GQA): 32 for Q and 4 for KV
32
+ - Number of Experts: 128
33
+ - Number of Activated Experts: 8
34
+ - Context Length: **262,144 natively**.
35
+
36
+ **NOTE: This model supports only non-thinking mode and does not generate ``<think></think>`` blocks in its output. Meanwhile, specifying `enable_thinking=False` is no longer required.**
37
+
38
+ For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [blog](https://qwenlm.github.io/blog/qwen3-coder/), [GitHub](https://github.com/QwenLM/Qwen3-Coder), and [Documentation](https://qwen.readthedocs.io/en/latest/).
39
+
40
+
41
+ ## Quickstart
42
+
43
+ We advise you to use the latest version of `transformers`.
44
+
45
+ With `transformers<4.51.0`, you will encounter the following error:
46
+ ```
47
+ KeyError: 'qwen3_moe'
48
+ ```
49
+
50
+ The following contains a code snippet illustrating how to use the model generate content based on given inputs.
51
+ ```python
52
+ from transformers import AutoModelForCausalLM, AutoTokenizer
53
+
54
+ model_name = "Hugston-Qwen/Qwen3-Coder-30B-A3B-Instruct"
55
+
56
+ # load the tokenizer and the model
57
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
58
+ model = AutoModelForCausalLM.from_pretrained(
59
+ model_name,
60
+ torch_dtype="auto",
61
+ device_map="auto"
62
+ )
63
+
64
+ # prepare the model input
65
+ prompt = "Write a quick sort algorithm."
66
+ messages = [
67
+ {"role": "user", "content": prompt}
68
+ ]
69
+ text = tokenizer.apply_chat_template(
70
+ messages,
71
+ tokenize=False,
72
+ add_generation_prompt=True,
73
+ )
74
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
75
+
76
+ # conduct text completion
77
+ generated_ids = model.generate(
78
+ **model_inputs,
79
+ max_new_tokens=65536
80
+ )
81
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
82
+
83
+ content = tokenizer.decode(output_ids, skip_special_tokens=True)
84
+
85
+ print("content:", content)
86
+ ```
87
+
88
+ **Note: If you encounter out-of-memory (OOM) issues, consider reducing the context length to a shorter value, such as `32,768`.**
89
+
90
+ For local use, applications such as HugstonOne, Ollama, LMStudio, MLX-LM, llama.cpp, and KTransformers have also supported Qwen3.
91
+
92
+ ## Agentic Coding
93
+
94
+ Hugston-Qwen3-Coder excels in tool calling capabilities.
95
+
96
+ You can simply define or use any tools as following example.
97
+ ```python
98
+ # Your tool implementation
99
+ def square_the_number(num: float) -> dict:
100
+ return num ** 2
101
+
102
+ # Define Tools
103
+ tools=[
104
+ {
105
+ "type":"function",
106
+ "function":{
107
+ "name": "square_the_number",
108
+ "description": "output the square of the number.",
109
+ "parameters": {
110
+ "type": "object",
111
+ "required": ["input_num"],
112
+ "properties": {
113
+ 'input_num': {
114
+ 'type': 'number',
115
+ 'description': 'input_num is a number that will be squared'
116
+ }
117
+ },
118
+ }
119
+ }
120
+ }
121
+ ]
122
+
123
+ import OpenAI
124
+ # Define LLM
125
+ client = OpenAI(
126
+ # Use a custom endpoint compatible with OpenAI API
127
+ base_url='http://localhost:8000/v1', # api_base
128
+ api_key="EMPTY"
129
+ )
130
+
131
+ messages = [{'role': 'user', 'content': 'square the number 1024'}]
132
+
133
+ completion = client.chat.completions.create(
134
+ messages=messages,
135
+ model="Qwen3-Coder-30B-A3B-Instruct",
136
+ max_tokens=65536,
137
+ tools=tools,
138
+ )
139
+
140
+ print(completion.choice[0])
141
+ ```
142
+
143
+ ## Best Practices
144
+
145
+ To achieve optimal performance, we recommend the following settings:
146
+
147
+ 1. **Sampling Parameters**:
148
+ - We suggest using `temperature=0.7`, `top_p=0.8`, `top_k=20`, `repetition_penalty=1.05`.
149
+
150
+ 2. **Adequate Output Length**: We recommend using an output length of 65,536 tokens for most queries, which is adequate for instruct models.
151
+
152
+
153
+ ### Citation
154
+
155
+ If you find our work helpful, feel free to give us a cite.
156
+
157
+ ```
158
+ @misc{qwen3technicalreport,
159
+ title={Qwen3 Technical Report},
160
+ author={Qwen Team},
161
+ year={2025},
162
+ eprint={2505.09388},
163
+ archivePrefix={arXiv},
164
+ primaryClass={cs.CL},
165
+ url={https://arxiv.org/abs/2505.09388},
166
+ url={https://hugston.com},
167
+ }
168
+ ```