Downloads · 30 days
647
30% of all-time downloads
nxp/Qwen2.5-Coder-1.5B-Instruct-Ara240
Qwen2.5-Coder-1.5B-Instruct-Ara240 is a text generation model from nxp. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
<div align="center" <div <a href="https://huggingface.co/nxp/Qwen2.5-Coder-1.5B-Ara240/blob/main/LICENSE"<img src="https://img.shields.io/badge/License-Apache%202.0-blue" alt="License Apache-2.0"</a <a href="https://h…
Downloads · 30 days
647
30% of all-time downloads
All-time downloads
2.2K
Public
Repo size
7 GB
Likes
0
Public
Click a slice to open those files.
.dvm1.9 GB · 99%
From the Hugging Face model README
NOTE: This repository contains the Qwen2.5-Coder-1.5B-Instruct model. This is NOT the Qwen2.5-Coder-1.5B (base) model. The name of the repository will be changed in the future to reflect this.
The Qwen2.5‑Coder‑1.5B-Instruct model is a code‑specialized large language model designed to deliver strong performance in code generation, reasoning, and automated code correction. Built as part of the Qwen2.5‑Coder series, which spans 0.5B to 32B parameters, the 1.5B variant inherits the improvements of the broader family, including training on 5.5 trillion tokens of diverse data such as source code, grounded text-to-code pairs, and high‑quality synthetic examples. Fine-tuned for instruction following, Qwen2.5-Coder-1.5B-Instruct is optimized for interactive code assistance, including natural language to code, code explanation, and debugging through conversational prompts. This repository hosts the quantized and compiled model for Ara240 DNPU.
This is a quantized and compiled version of Qwen/Qwen2.5-Coder-1.5B-Instruct optimized for Ara240 DNPU.
This model is a derivative work with the following changes from the original:
Original model available at: Qwen/Qwen2.5-Coder-1.5B-Instruct.
This model inherits all limitations from the original Qwen2.5-Coder-1.5B-Instruct model. Additional limitations:
Make sure your host already has Optimum-Ara installed and ready for use. A step by step guide can be found at NXP/Optimum-Ara.
Note: You might need to change the
MODEL_PATHandTOKENIZER_PATHto match your setup. For i.MX platforms with the default BSP setup, this example works directly.
Fetch the model from Hugging Face:
uv run hf download nxp/Qwen2.5-Coder-1.5B-Ara240 --local-dir /usr/share/llm/Qwen2.5-Coder-1.5B
Create a Python script with the example code below. You can name it something like qwen2_5_coder_1.5b_instruct.py:
# Copyright 2026 NXP
# SPDX-License-Identifier: Apache-2.0
import os
import sys
from transformers import Qwen2TokenizerFast, AutoModelForCausalLM
import optimum.ara
from transformers import TextStreamer
MODEL_PATH = os.path.realpath("/usr/share/llm/Qwen2.5-Coder-1.5B")
TOKENIZER_PATH = "/usr/share/llm/Qwen2.5-Coder-1.5B"
INPUT_PROMPT = "Write a Python script that computes the factorial of a number."
tokenizer = Qwen2TokenizerFast.from_pretrained(TOKENIZER_PATH)
model = AutoModelForCausalLM.from_pretrained(MODEL_PATH)
messages = [
{"role": "system", "content": "You are a helpful python coding assistant."},
{"role": "user", "content": INPUT_PROMPT},
]
inputs = tokenizer.apply_chat_template(
conversation=messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(inputs, return_tensors="pt")
streamer = TextStreamer(tokenizer, stream=sys.stdout)
print("\n" + "=" * 50)
print("USER PROMPT:")
print("=" * 50)
print(INPUT_PROMPT)
print("=" * 50 + "\n")
output = model.generate(**inputs, streamer=streamer, max_new_tokens=256)
del model
Run the example with the command below:
uv run qwen2_5_coder_1.5b_instruct.py
[2026-07-14 17:11:03] [INFO] [modeling_base.py:_get_llm_dvm_path] Found dvm_file, /usr/share/llm/Qwen2.5-Coder-1.5B-Instruct/model.dvm
[INFO] - DVAPI: loaded dvinfclient lib: /usr/lib/libaraclient_aarch64.so
[2026-07-14 17:11:03] [INFO] [modeling_base.py:_handle_device_map] Model size: 1.73 GB, Additional required memory: 600.00 MB
[2026-07-14 17:11:03] [INFO] [modeling_base.py:_handle_device_map] Total size required for Model: 2.32 GB
[2026-07-14 17:11:03] [INFO] [modeling_base.py:_handle_device_map] Endpoint : 0 has free space : 15.77 GB
I:DVPULB[260714171103] model type is ara2 llm
I:DVPULB[260714171103] Successfully read llm_params_t from model file
I:DVPULB[260714171103] model found to be dyn quant v2 model
==================================================
USER PROMPT:
==================================================
Write a Python script that computes the factorial of a number.
==================================================
def factorial(n):
# Base case: factorial of 0 or 1 is 1
if n == 0 or n == 1:
return 1
# Recursive case: n * factorial of (n-1)
else:
return n * factorial(n-1)
# Example usage
number = int(input("Enter a number to calculate its factorial: "))
result = factorial(number)
print(f"The factorial of {number} is {result}")
In this solution, the `factorial` function calculates the factorial of a given number `n`. The function uses recursion to multiply each number from `n` down to `1`, effectively computing the product. The base cases are when `n` is either 0 or 1, in which case it returns 1. For all other values of `n`, it calls itself with `n-1`, multiplying the result by the current value of `n`.
This model is released under the Apache License 2.0, the same license as the original Qwen/Qwen2.5-Coder-1.5B-Instruct model.
If you use this model, please cite both this work and the original model:
@article{hui2024qwen2,
title={Qwen2.5-Coder Technical Report},
author={Hui, Binyuan and Yang, Jian and Cui, Zeyu and Yang, Jiaxi and Liu, Dayiheng and Zhang, Lei and Liu, Tianyu and Zhang, Jiajun and Yu, Bowen and Dang, Kai and others},
journal={arXiv preprint arXiv:2409.12186},
year={2024}
}
@article{qwen2,
title={Qwen2 Technical Report},
author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
journal={arXiv preprint arXiv:2407.10671},
year={2024}
}