qwen2-5-72b-instruct

Qwen2.5-72B-Instruct

Qwen2.5-72B-Instruct is a flagship 72.7-billion parameter, open-weight model engineered for high-stakes AI production, advanced reasoning, and complex conversational tasks. Optimised with an 80-layer architecture using Grouped Query Attention (GQA), it delivers exceptional performance in coding, mathematics, and structured data tasks like JSON and table processing.

Other
Text Generation
Transformers
Safetensors
English
by @AIOZAI
9
0

Last updated: 8 hours ago


Generic badge Generic badge

Qwen2.5-72B-Instruct

Summary

Introduction

Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, the author release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters. Qwen2.5 brings the following improvements upon Qwen2:

  • Significantly more knowledge and has greatly improved capabilities in coding and mathematics, thanks to our specialized expert models in these domains.
  • Significant improvements in instruction following, generating long texts (over 8K tokens), understanding structured data (e.g, tables), and generating structured outputs especially JSON. More resilient to the diversity of system prompts, enhancing role-play implementation and condition-setting for chatbots.
  • Long-context Support up to 128K tokens and can generate up to 8K tokens.
  • Multilingual support for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.

This repo contains the instruction-tuned 72B Qwen2.5 model, which has the following features:

  • Type: Causal Language Models
  • Training Stage: Pretraining & Post-training
  • Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
  • Number of Parameters: 72.7B
  • Number of Paramaters (Non-Embedding): 70.0B
  • Number of Layers: 80
  • Number of Attention Heads (GQA): 64 for Q and 8 for KV
  • Context Length: Full 131,072 tokens and generation 8192 tokens

Parameters

Inputs

  • prompt - (text): User-provided input can be a question, a request, or the context to be addressed. The system uses the prompt to analyze, infer, and generate a corresponding response.

Output

  • output - (text):The content generated after the token is the final answer that the model returns to the user.

Usage for developers

Please find below the details to track the information and access the code for processing the model on our platform.

Requirements

pip install -r requirements.txt

Code based on AIOZ structure

from transformers import AutoModelForCausalLM, AutoTokenizer

...

def do_ai_task(
        prompt: Union[str, Path],
        model_storage_directory: Union[str, Path],
        device: Literal["cpu", "cuda", "gpu"] = "cpu",
        *args, **kwargs) -> Any:
    """Define AI task: load model, pre-process, post-process, etc ..."""
    # Define AI task workflow. Below is an example

    model_name = os.path.join(model_storage_directory, "Qwen2.5-72B-Instruct")

    model = AutoModelForCausalLM.from_pretrained(
        model_name,
        torch_dtype="auto",
        device_map="auto"
    )
    tokenizer = AutoTokenizer.from_pretrained(model_name)

    ...

    text_output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
    return text_output

Reference

This repository is based on and inspired by Qwen's work. We sincerely appreciate their generosity in sharing the code.

License

We respect and comply with the terms of the author's license cited in the Reference section.

Citation

@misc{qwen2.5,
    title = {Qwen2.5: A Party of Foundation Models},
    url = {https://qwenlm.github.io/blog/qwen2.5/},
    author = {Qwen Team},
    month = {September},
    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}
}