Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: support qwen2.5-coder-instruct and qwen2.5 sglang #2332

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 179 additions & 1 deletion xinference/model/llm/llm_family.json
Original file line number Diff line number Diff line change
Expand Up @@ -7247,7 +7247,99 @@
},
{
"version": 1,
"context_length": 131072,
"context_length": 32768,
"model_name": "qwen2.5",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"generate"
],
"model_description": "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.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "0_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-0.5B",
"model_revision": "2630d3d2321bc1f1878f702166d1b2af019a7310"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-1.5B",
"model_revision": "e5dfabbcffd9b0c7b31d89b82c5a6b72e663f32c"
},
{
"model_format": "pytorch",
"model_size_in_billions": 3,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-3B",
"model_revision": "e4aa5ac50aa507415cda96cc99eb77ad0a3d2d34"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-7B",
"model_revision": "09a0bac5707b43ec44508eab308b0846320c1ed4"
},
{
"model_format": "pytorch",
"model_size_in_billions": 14,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-14B",
"model_revision": "d02b64ba1ce86bf9948668a13f82709600431ccc"
},
{
"model_format": "pytorch",
"model_size_in_billions": 32,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-32B",
"model_revision": "ff23665d01c3665be5fdb271d18a62090b65c06d"
},
{
"model_format": "pytorch",
"model_size_in_billions": 72,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-72B",
"model_revision": "587cc4061cf6a7cc0d429d05c109447e5cf063af"
}
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-instruct",
"model_lang": [
"en",
Expand Down Expand Up @@ -7604,5 +7696,91 @@
"<|im_start|>",
"<|im_end|>"
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-coder",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"generate"
],
"model_description": "Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen).",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-Coder-1.5B",
"model_revision": "835b517c690ba0a4a54212e87a0d6ab1a7fc03d0"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-Coder-7B",
"model_revision": "e8d5fbb4775a03fed82f0b6c28fd498b09052705"
}
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-coder-instruct",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"chat",
"tools"
],
"model_description": "Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen).",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-Coder-1.5B-Instruct",
"model_revision": "9ce57ed54f45f61e349bb44ec689e4a013b8be7c"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-Coder-7B-Instruct",
"model_revision": "686220118f733b5fe32992d02604a41f3a45b585"
}
],
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- '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 <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\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 {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + 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<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"stop_token_ids": [
151643,
151644,
151645
],
"stop": [
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>"
]
}
]
191 changes: 190 additions & 1 deletion xinference/model/llm/llm_family_modelscope.json
Original file line number Diff line number Diff line change
Expand Up @@ -4960,7 +4960,106 @@
},
{
"version": 1,
"context_length": 131072,
"context_length": 32768,
"model_name": "qwen2.5",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"generate"
],
"model_description": "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.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "0_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-0.5B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-1.5B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 3,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-3B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-7B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 14,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-14B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 32,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-32B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 72,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "Qwen/Qwen2.5-72B",
"model_revision": "master",
"model_hub": "modelscope"
}
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-instruct",
"model_lang": [
"en",
Expand Down Expand Up @@ -5345,5 +5444,95 @@
"<|im_start|>",
"<|im_end|>"
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-coder",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"generate"
],
"model_description": "Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen).",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "qwen/Qwen2.5-Coder-1.5B",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "qwen/Qwen2.5-Coder-7B",
"model_revision": "master",
"model_hub": "modelscope"
}
]
},
{
"version": 1,
"context_length": 32768,
"model_name": "qwen2.5-coder-instruct",
"model_lang": [
"en",
"zh"
],
"model_ability": [
"chat",
"tools"
],
"model_description": "Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen).",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "qwen/Qwen2.5-Coder-1.5B-Instruct",
"model_revision": "master",
"model_hub": "modelscope"
},
{
"model_format": "pytorch",
"model_size_in_billions": 7,
"quantizations": [
"4-bit",
"8-bit",
"none"
],
"model_id": "qwen/Qwen2.5-Coder-7B-Instruct",
"model_revision": "master",
"model_hub": "modelscope"
}
],
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- '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 <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\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 {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + 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<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"stop_token_ids": [
151643,
151644,
151645
],
"stop": [
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>"
]
}
]
Loading
Loading