Intel/Qwen3-Coder-Next-int4-AutoRound
405.8k
1---2base_model:3- Qwen/Qwen3-Coder-Next4pipeline_tag: text-generation5---6 7## Model Details8 9This model is an int4 model with group_size 128 and symmetric quantization of [Qwen/Qwen3-Coder-Next](https://huggingface.co/Qwen/Qwen3-Coder-Next) generated by [intel/auto-round](https://github.com/intel/auto-round). Please follow the license of the original model.10 11## How to Use12 13### HF Usage14 15```python16from transformers import AutoModelForCausalLM, AutoTokenizer17 18model_name = "Intel/Qwen3-Coder-Next-int4-AutoRound"19 20# load the tokenizer and the model21tokenizer = AutoTokenizer.from_pretrained(model_name)22model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")23 24# prepare the model input25prompt = "Write a quick sort algorithm."26messages = [{"role": "user", "content": prompt}]27text = tokenizer.apply_chat_template(28 messages,29 tokenize=False,30 add_generation_prompt=True,31)32model_inputs = tokenizer([text], return_tensors="pt").to(model.device)33 34# conduct text completion35generated_ids = model.generate(**model_inputs, max_new_tokens=65536)36output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :].tolist()37 38content = tokenizer.decode(output_ids, skip_special_tokens=True)39 40print("content:", content)41```42 43### VLLM Usage44 45```bash46vllm serve Intel/Qwen3-Coder-Next-int4-AutoRound \47 --trust-remote-code \48 --dtype bfloat16 \49 --tensor_parallel_size 150```51 52## Generate the Model53 54```bash55auto-round --model_name Qwen/Qwen3-Coder-Next --iters 200 --bits 4 --output_dir Qwen3-Coder-Next-int4-AutoRound56```57 58## Ethical Considerations and Limitations59 60The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.61Therefore, before deploying any applications of the model, developers should perform safety testing.62 63## Caveats and Recommendations64 65Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.66Here are a couple of useful links to learn more about Intel's AI software:67 68- [Intel Neural Compressor](https://github.com/intel/neural-compressor)69- [AutoRound](https://github.com/intel/auto-round)70 71## Disclaimer72 73The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.74 75## Cite76 77```78@article{cheng2023optimize,79 title={Optimize weight rounding via signed gradient descent for the quantization of llms},80 author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},81 journal={arXiv preprint arXiv:2309.05516},82 year={2023}83}84```85 86[arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)87 