From 189b18223aed250603adf65f066d94515d330233 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Fri, 1 May 2026 02:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: bullerwins/Qwen2.5-7B-Instruct-GGUF Source: Original Platform --- .gitattributes | 47 ++++++++++ Qwen2.5-7B-Instruct-Q3_K_L.gguf | 3 + Qwen2.5-7B-Instruct-Q3_K_M.gguf | 3 + Qwen2.5-7B-Instruct-Q3_K_S.gguf | 3 + Qwen2.5-7B-Instruct-Q4_K_M.gguf | 3 + Qwen2.5-7B-Instruct-Q4_K_S.gguf | 3 + Qwen2.5-7B-Instruct-Q5_K_M.gguf | 3 + Qwen2.5-7B-Instruct-Q5_K_S.gguf | 3 + Qwen2.5-7B-Instruct-Q6_K.gguf | 3 + Qwen2.5-7B-Instruct-Q8_0.gguf | 3 + README.md | 147 ++++++++++++++++++++++++++++++++ configuration.json | 1 + 12 files changed, 222 insertions(+) create mode 100644 .gitattributes create mode 100644 Qwen2.5-7B-Instruct-Q3_K_L.gguf create mode 100644 Qwen2.5-7B-Instruct-Q3_K_M.gguf create mode 100644 Qwen2.5-7B-Instruct-Q3_K_S.gguf create mode 100644 Qwen2.5-7B-Instruct-Q4_K_M.gguf create mode 100644 Qwen2.5-7B-Instruct-Q4_K_S.gguf create mode 100644 Qwen2.5-7B-Instruct-Q5_K_M.gguf create mode 100644 Qwen2.5-7B-Instruct-Q5_K_S.gguf create mode 100644 Qwen2.5-7B-Instruct-Q6_K.gguf create mode 100644 Qwen2.5-7B-Instruct-Q8_0.gguf create mode 100644 README.md create mode 100644 configuration.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..53d7257 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,47 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bin.* filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zstandard filter=lfs diff=lfs merge=lfs -text +*.tfevents* filter=lfs diff=lfs merge=lfs -text +*.db* filter=lfs diff=lfs merge=lfs -text +*.ark* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.gguf* filter=lfs diff=lfs merge=lfs -text +*.ggml filter=lfs diff=lfs merge=lfs -text +*.llamafile* filter=lfs diff=lfs merge=lfs -text +*.pt2 filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/Qwen2.5-7B-Instruct-Q3_K_L.gguf b/Qwen2.5-7B-Instruct-Q3_K_L.gguf new file mode 100644 index 0000000..a914e23 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q3_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c909a7d7d3fe9074597bf293d776a63a8efbbbb3e740a483dab865d3ffa6839e +size 4088459680 diff --git a/Qwen2.5-7B-Instruct-Q3_K_M.gguf b/Qwen2.5-7B-Instruct-Q3_K_M.gguf new file mode 100644 index 0000000..2a5ee08 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q3_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e69161e57ba46032ebffb93c2565a878db473af6a32a0f9383ffe53d14884f4 +size 3808391584 diff --git a/Qwen2.5-7B-Instruct-Q3_K_S.gguf b/Qwen2.5-7B-Instruct-Q3_K_S.gguf new file mode 100644 index 0000000..0b80767 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q3_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50658c7a92705dc8633671a3ca393193e2723120d1ecaca66fb70656fb4c91a7 +size 3492368800 diff --git a/Qwen2.5-7B-Instruct-Q4_K_M.gguf b/Qwen2.5-7B-Instruct-Q4_K_M.gguf new file mode 100644 index 0000000..b65cd13 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a6cd3ed1e9aa78637bb8b2713555b0c2d608867900dab7eb18884373705c972 +size 4683073952 diff --git a/Qwen2.5-7B-Instruct-Q4_K_S.gguf b/Qwen2.5-7B-Instruct-Q4_K_S.gguf new file mode 100644 index 0000000..3f3dd60 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q4_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7b78ecff3eee0db1c8fa30b1b738e247e5bbee004e0a85ca5f02a7b6b676da4 +size 4457769376 diff --git a/Qwen2.5-7B-Instruct-Q5_K_M.gguf b/Qwen2.5-7B-Instruct-Q5_K_M.gguf new file mode 100644 index 0000000..49b5059 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q5_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34428d0b049249e0f365e38020eafb4962ddd7a7d303c1b6062c3d95e19e891f +size 5444831648 diff --git a/Qwen2.5-7B-Instruct-Q5_K_S.gguf b/Qwen2.5-7B-Instruct-Q5_K_S.gguf new file mode 100644 index 0000000..0dceb88 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q5_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d04b9cb98c611526a9f83d208074230f78f5520171dd3b51b04547fc4453dd88 +size 5315176864 diff --git a/Qwen2.5-7B-Instruct-Q6_K.gguf b/Qwen2.5-7B-Instruct-Q6_K.gguf new file mode 100644 index 0000000..4d52767 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q6_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7a6ffc51649a4db8678d1240a05a71acbd36aa4e48cae5460b720ed034cd54d +size 6254199200 diff --git a/Qwen2.5-7B-Instruct-Q8_0.gguf b/Qwen2.5-7B-Instruct-Q8_0.gguf new file mode 100644 index 0000000..e405aa2 --- /dev/null +++ b/Qwen2.5-7B-Instruct-Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfb43fdcb693fd6d650900c6595be1c23e022c35afadba511949dcc26b3625f1 +size 8098525600 diff --git a/README.md b/README.md new file mode 100644 index 0000000..b6def63 --- /dev/null +++ b/README.md @@ -0,0 +1,147 @@ +--- +license: apache-2.0 +license_link: https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/blob/main/LICENSE +language: +- zho +- eng +- fra +- spa +- por +- deu +- ita +- rus +- jpn +- kor +- vie +- tha +- ara +pipeline_tag: text-generation +base_model: Qwen/Qwen2.5-7B-Instruct +tags: +- chat +library_name: transformers +--- + +# Qwen2.5-7B-Instruct + + Chat + + +## Introduction + +Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, we 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 7B 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: 7.61B +- Number of Paramaters (Non-Embedding): 6.53B +- Number of Layers: 28 +- Number of Attention Heads (GQA): 28 for Q and 4 for KV +- Context Length: Full 131,072 tokens and generation 8192 tokens + - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts. + +For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5/), [GitHub](https://github.com/QwenLM/Qwen2.5), and [Documentation](https://qwen.readthedocs.io/en/latest/). + +## Requirements + +The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`. + +With `transformers<4.37.0`, you will encounter the following error: +``` +KeyError: 'qwen2' +``` + +## Quickstart + +Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents. + +```python +from transformers import AutoModelForCausalLM, AutoTokenizer + +model_name = "Qwen/Qwen2.5-7B-Instruct" + +model = AutoModelForCausalLM.from_pretrained( + model_name, + torch_dtype="auto", + device_map="auto" +) +tokenizer = AutoTokenizer.from_pretrained(model_name) + +prompt = "Give me a short introduction to large language model." +messages = [ + {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."}, + {"role": "user", "content": prompt} +] +text = tokenizer.apply_chat_template( + messages, + tokenize=False, + add_generation_prompt=True +) +model_inputs = tokenizer([text], return_tensors="pt").to(model.device) + +generated_ids = model.generate( + **model_inputs, + max_new_tokens=512 +) +generated_ids = [ + output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) +] + +response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] +``` + +### Processing Long Texts + +The current `config.json` is set for context length up to 32,768 tokens. +To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://arxiv.org/abs/2309.00071), a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts. + +For supported frameworks, you could add the following to `config.json` to enable YaRN: +```json +{ + ..., + "rope_scaling": { + "factor": 4.0, + "original_max_position_embeddings": 32768, + "type": "yarn" + } +} +``` + +For deployment, we recommend using vLLM. +Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM. +Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**. +We advise adding the `rope_scaling` configuration only when processing long contexts is required. + +## Evaluation & Performance + +Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/). + +For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html). + +## Citation + +If you find our work helpful, feel free to give us a cite. + +``` +@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} +} +``` \ No newline at end of file diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file