{"Code":200,"Data":{"AigcAttributes":"{}","AigcIsTop":0,"AigcType":"","AlreadyStar":false,"ApplyMeta":"{}","ApprovalMode":1,"ApprovalNotifyEmail":"","Architectures":["Qwen2ForCausalLM"],"Avatar":"https://resouces.modelscope.cn/avatar/56d9e1ec-12f1-4d2b-a749-04ade9830aba.png","Backbone":[],"BackendSupport":{"architectures":["Qwen2ForCausalLM"],"backend_info":{"deploy_task":["text","emb"],"lmdeploy":{"text":"0.9.1"},"lmdeploy_turbomind":{"text":"0.9.1"},"ollama":null,"sglang":{"text":"0.5.2"},"vllm":{"emb":"0.9.2","text":"0.9.2"}},"model_id":"Qwen/Qwen2.5-7B-Instruct"},"BaseModel":["Qwen/Qwen2.5-7B"],"BaseModelRelation":"finetune","CardReady":0,"CardUnreadyReason":"","CertificationCreateBy":"","CertificationCreatedTime":-62135596800,"ChineseName":"千问2.5-7B-Instruct","CoverHeight":0,"CoverImages":[],"CoverWidth":0,"CreatedBy":"Cherrytest","CreatedTime":1726523776,"DashSdkParameter":"","Datasets":{},"DemoAvailable":0,"DemoUnavailableReason":"","Description":"Qwen 2.5系列开源模型基于更大的训练数据集训练而成，在编程能力、数学能力以及指令遵循能力等方面都有显著提升。同时Qwen 2.5提供强大的多语言能力，包括了29种以上语言的支持。","Domain":[],"Downloads":7351114,"ExampleCodeAvailable":0,"ExampleCodeUnavailableReason":"","ForbiddenVisibilityUpdate":false,"Frameworks":[],"FromSite":"maas","Id":331843,"Integrating":0,"IntegrationFailureLog":"","IntegrationFailureReason":"","IsAccessible":1,"IsCertification":4,"IsHot":0,"IsNewModel":false,"IsOnline":1,"IsPreTrain":0,"IsPublished":1,"IsTop":0,"Language":["en"],"LastUpdatedTime":1741335540,"Libraries":["transformer","safetensors"],"License":"apache-2.0","LicenseLink":"","LicenseName":"","Meta":"","Metrics":[],"ModelDetail":{},"ModelInfos":{"safetensor":{"chat_template":"{%- if tools %}\n    {{- '\u003c|im_start|\u003esystem\\n' }}\n    {%- if messages[0]['role'] == 'system' %}\n        {{- messages[0]['content'] }}\n    {%- else %}\n        {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n    {%- endif %}\n    {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within \u003ctools\u003e\u003c/tools\u003e XML tags:\\n\u003ctools\u003e\" }}\n    {%- for tool in tools %}\n        {{- \"\\n\" }}\n        {{- tool | tojson }}\n    {%- endfor %}\n    {{- \"\\n\u003c/tools\u003e\\n\\nFor each function call, return a json object with function name and arguments within \u003ctool_call\u003e\u003c/tool_call\u003e XML tags:\\n\u003ctool_call\u003e\\n{\\\"name\\\": \u003cfunction-name\u003e, \\\"arguments\\\": \u003cargs-json-object\u003e}\\n\u003c/tool_call\u003e\u003c|im_end|\u003e\\n\" }}\n{%- else %}\n    {%- if messages[0]['role'] == 'system' %}\n        {{- '\u003c|im_start|\u003esystem\\n' + messages[0]['content'] + '\u003c|im_end|\u003e\\n' }}\n    {%- else %}\n        {{- '\u003c|im_start|\u003esystem\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.\u003c|im_end|\u003e\\n' }}\n    {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n    {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n        {{- '\u003c|im_start|\u003e' + message.role + '\\n' + message.content + '\u003c|im_end|\u003e' + '\\n' }}\n    {%- elif message.role == \"assistant\" %}\n        {{- '\u003c|im_start|\u003e' + message.role }}\n        {%- if message.content %}\n            {{- '\\n' + message.content }}\n        {%- endif %}\n        {%- for tool_call in message.tool_calls %}\n            {%- if tool_call.function is defined %}\n                {%- set tool_call = tool_call.function %}\n            {%- endif %}\n            {{- '\\n\u003ctool_call\u003e\\n{\"name\": \"' }}\n            {{- tool_call.name }}\n            {{- '\", \"arguments\": ' }}\n            {{- tool_call.arguments | tojson }}\n            {{- '}\\n\u003c/tool_call\u003e' }}\n        {%- endfor %}\n        {{- '\u003c|im_end|\u003e\\n' }}\n    {%- elif message.role == \"tool\" %}\n        {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n            {{- '\u003c|im_start|\u003euser' }}\n        {%- endif %}\n        {{- '\\n\u003ctool_response\u003e\\n' }}\n        {{- message.content }}\n        {{- '\\n\u003c/tool_response\u003e' }}\n        {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n            {{- '\u003c|im_end|\u003e\\n' }}\n        {%- endif %}\n    {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n    {{- '\u003c|im_start|\u003eassistant\\n' }}\n{%- endif %}\n","files":[{"name":"model.safetensors.index.json","sha256":"624bf7c47cd12468fdc16e38a47cf4f19e0415b859a223ba3c027eed2f0e1028","size":27752},{"name":"model-00001-of-00004.safetensors","sha256":"a1333e6293854747c481288ea83b348226af178dd565c49b6f9495ba1966aba7","size":3945441440},{"name":"model-00002-of-00004.safetensors","sha256":"f5d25a2772cb825164a2a2c0fb6d51a87e282abf21e4dd75bc5cfb3cd0ea6185","size":3864726352},{"name":"model-00003-of-00004.safetensors","sha256":"8efdec4c1bc12317ae1a38dc42b595ce777738a64deea3fcb8a0a91381bcdfd5","size":3864726424},{"name":"model-00004-of-00004.safetensors","sha256":"1a72d403cdf0c1ec3cb7f289f17b394a01e64394c2e9b3c0f94dbce3faf879bd","size":3556377672}],"model_size":7615616512,"tensor_type":["BF16"]}},"ModelRevisions":null,"ModelSource":"USER_UPLOAD","ModelTools":"","ModelType":["qwen2"],"MuseInfo":null,"NEXA":{"Catalogues":null,"ModelCover":"","ScientificField":"","Source":"","SubScientificField":null},"Name":"Qwen2.5-7B-Instruct","NewVersion":"","NickName":"小橙鱼","OfficialTags":null,"OpenAiSwingDeployInfo":{"Order":999999,"Recommend":[{"Backend":["vllm"],"Channel":"fc","GpuMemory":"0","ImageTag":["ubuntu22.04-cuda12.4.0-py311-torch2.6.0-1.27.0-LLM"],"InstanceType":"fc.gpu.tesla.1","Memory":"32768","ModelFamily":"","Version":"v1.0.0","deploy_task":["text"]},{"Backend":["vllm"],"Channel":"eas","GpuMemory":"0","ImageTag":["ubuntu22.04-cuda12.4.0-py310-torch2.5.1-1.23.1-LLM"],"InstanceType":"ecs.gn6i-c40g1.10xlarge","Memory":"32768","ModelFamily":"","Version":"v1.0.0","deploy_task":["text"]}],"lmdeploy":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"ollama":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"pipeline":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"vllm":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""}},"Organization":{"ApplyFailureReason":"","ApplyReason":"","Avatar":"https://resources.modelscope.cn/avatar/4c40e6ce-1348-43b5-a3bc-6bafec6ac805.jpg","CreateCompetition":false,"CreatedBy":"Cherrytest","Description":"[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"欢迎来到 Qwen 👋 !\"]]],[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"这是 Qwen 的组织，来自阿里的大模型家族。在这个组织中，我们不断发布大型语言模型 (LLM)、大型多模态模型 (LMM) 和其他 AGI 相关项目。快来查看并享受吧！\"]]]]","DisplayUrl":"","Email":"","EmailDomain":"","FollowerCnt":0,"FromSite":"","FullName":"千问","GithubAddress":"https://qwen.ai/","GmtCreated":"2023-08-02T03:48:45Z","GmtModified":"2026-11-06T03:01:02Z","Id":209,"InitAdminMembers":"","IsApply":false,"IsCertification":"","MemberCnt":0,"Mobile":"","Name":"Qwen","Path":"","Roles":null,"SocialLinks":null,"StarCnt":0,"Status":0,"SubscribeVo":null,"Type":2},"PaiModelGalleryUrl":{"deploy":"https://account.aliyun.com/login/login.htm?oauth_callback=https%3A//pai.console.aliyun.com/regionId%3Dcn-hangzhou%23/quick-start/models/qwen2.5-7b-instruct/intro%3FviewType%3DDeploy%26from%3DModelScope\u0026lang=zh","evaluation":"https://account.aliyun.com/login/login.htm?oauth_callback=https%3A//pai.console.aliyun.com/regionId%3Dcn-hangzhou%23/quick-start/evaluations/create%3FmodelName%3Dqwen2.5-7b-instruct%26modelOrigin%3DPAI\u0026lang=zh","train":"https://account.aliyun.com/login/login.htm?oauth_callback=https%3A//pai.console.aliyun.com/regionId%3Dcn-hangzhou%23/quick-start/models/qwen2.5-7b-instruct/intro%3FviewType%3DTrain%26from%3DModelScope\u0026lang=zh"},"PaiSdkParameter":null,"Path":"Qwen","ProtectedMode":2,"ReadMeContent":"\n# Qwen2.5-7B-Instruct\n\u003ca href=\"https://chat.qwenlm.ai/\" target=\"_blank\" style=\"margin: 2px;\"\u003e\n    \u003cimg 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;\"/\u003e\n\u003c/a\u003e\n\n## Introduction\n\nQwen2.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:\n\n- Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.\n- 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.\n- **Long-context Support** up to 128K tokens and can generate up to 8K tokens.\n- **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more. \n\n**This repo contains the instruction-tuned 7B Qwen2.5 model**, which has the following features:\n- Type: Causal Language Models\n- Training Stage: Pretraining \u0026 Post-training\n- Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias\n- Number of Parameters: 7.61B\n- Number of Paramaters (Non-Embedding): 6.53B\n- Number of Layers: 28\n- Number of Attention Heads (GQA): 28 for Q and 4 for KV\n- Context Length: Full 131,072 tokens and generation 8192 tokens\n  - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.\n\nFor 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/).\n\n## Requirements\n\nThe code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.\n\nWith `transformers\u003c4.37.0`, you will encounter the following error:\n```\nKeyError: 'qwen2'\n```\n\n## Quickstart\n\nHere provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.\n\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel_name = \"Qwen/Qwen2.5-7B-Instruct\"\n\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name,\n    torch_dtype=\"auto\",\n    device_map=\"auto\"\n)\ntokenizer = AutoTokenizer.from_pretrained(model_name)\n\nprompt = \"Give me a short introduction to large language model.\"\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are Qwen, created by Alibaba Cloud. You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": prompt}\n]\ntext = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\nmodel_inputs = tokenizer([text], return_tensors=\"pt\").to(model.device)\n\ngenerated_ids = model.generate(\n    **model_inputs,\n    max_new_tokens=512\n)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)\n]\n\nresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]\n```\n\n### Processing Long Texts\n\nThe current `config.json` is set for context length up to 32,768 tokens.\nTo 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.\n\nFor supported frameworks, you could add the following to `config.json` to enable YaRN:\n```json\n{\n  ...,\n  \"rope_scaling\": {\n    \"factor\": 4.0,\n    \"original_max_position_embeddings\": 32768,\n    \"type\": \"yarn\"\n  }\n}\n```\n\nFor deployment, we recommend using vLLM. \nPlease refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.\nPresently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**. \nWe advise adding the `rope_scaling` configuration only when processing long contexts is required.\n\n## Evaluation \u0026 Performance\n\nDetailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).\n\nFor requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).\n\n## Citation\n\nIf you find our work helpful, feel free to give us a cite.\n\n```\n@misc{qwen2.5,\n    title = {Qwen2.5: A Party of Foundation Models},\n    url = {https://qwenlm.github.io/blog/qwen2.5/},\n    author = {Qwen Team},\n    month = {September},\n    year = {2024}\n}\n\n@article{qwen2,\n      title={Qwen2 Technical Report}, \n      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},\n      journal={arXiv preprint arXiv:2407.10671},\n      year={2024}\n}\n```\n","ReadMeTips":null,"RelatedArxivId":["2309.00071","2407.10671"],"RelatedPaper":[35495,39551],"Revision":"master","Stars":577,"StorageSize":15242807272,"Studios":[],"SubVisionFoundation":"","SupportApiInference":false,"SupportDashDeployment":0,"SupportDashInference":0,"SupportDashTraining":0,"SupportDeployment":0,"SupportExperience":0,"SupportFinetuning":0,"SupportFlexTrain":0,"SupportInference":"","SupportPaiModelGallery":["deploy","train","evaluation"],"SupportPaiSdk":8,"SupportPivotEval":false,"SwingDeployInfo":null,"Tags":["chat"],"Tasks":[{"ChineseName":"文本生成","Description":"","DomainName":"nlp","Id":22,"IsExhibition":true,"IsHot":0,"IsLeaf":true,"IsLoginRequired":true,"IsRetrieval":true,"Level":1,"Name":"text-generation","ParentId":-1,"ParentTask":null,"Sorting":0,"SupportWidgets":false,"TypicalModel":"","WidgetConfig":"{\"task\": \"text-generation\", \"inputs\": [{\"type\": \"text\", \"validator\": {\"max_words\": \"1000\"}, \"displayType\": \"OnlyTextArea\"}], \"output\": {\"displayType\": \"ReadonlyText\", \"transformOutputs\": [{\"outputKey\": \"text\"}], \"displayOutputMapping\": \"text\"}, \"examples\": []}","WidgetValidator":""}],"Tools":[],"TriggerWords":null,"Visibility":5,"VisionFoundation":"","_":null,"widgets":[]},"Message":"success","RequestId":"edb1d52d-ce49-481f-857a-07c435f5529b","Success":true}