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 yi-coder-chat #2302

Merged
merged 6 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
77 changes: 77 additions & 0 deletions xinference/model/llm/llm_family.json
Original file line number Diff line number Diff line change
Expand Up @@ -7093,5 +7093,82 @@
"stop": [
"<|end▁of▁sentence|>"
]
},
{
"version": 1,
"context_length": 131072,
"model_name": "yi-coder-chat",
"model_lang": [
"en"
],
"model_ability": [
"chat"
],
"model_description": "Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters.Excelling in long-context understanding with a maximum context length of 128K tokens.Supporting 52 major programming languages, including popular ones such as Java, Python, JavaScript, and C++.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": 9,
"quantizations": [
"none"
],
"model_id": "01ai/Yi-Coder-9B-Chat",
"model_revision": "356a1f8d4e4a606d0b879e54191ca809918576b8"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"none"
],
"model_id": "01ai/Yi-Coder-1.5B-Chat",
"model_revision": "92fdd1b2f1539ac990e7f4a921db5601da2f0299"
}
],
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>' + '\n' }}{% endif %}{% endfor %}",
"stop_token_ids": [
1,
2,
6,
7
],
"stop": [
"<|startoftext|>",
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>"
]
},
{
"version": 1,
"context_length": 131072,
"model_name": "yi-coder",
"model_lang": [
"en"
],
"model_ability": [
"generate"
],
"model_description": "Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters.Excelling in long-context understanding with a maximum context length of 128K tokens.Supporting 52 major programming languages, including popular ones such as Java, Python, JavaScript, and C++.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": 9,
"quantizations": [
"none"
],
"model_id": "01-ai/Yi-Coder-9B",
"model_revision": "e20f8087a9507ac8bce409dc5db5d0c608124238"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"none"
],
"model_id": "01-ai/Yi-Coder-1.5B",
"model_revision": "00e59e64f47d3c78e4cfbdd345888479797e8109"
}
]
}
]
81 changes: 81 additions & 0 deletions xinference/model/llm/llm_family_modelscope.json
Original file line number Diff line number Diff line change
Expand Up @@ -4808,5 +4808,86 @@
"stop": [
"<|end▁of▁sentence|>"
]
},
{
"version": 1,
"context_length": 131072,
"model_name": "yi-coder-chat",
"model_lang": [
"en"
],
"model_ability": [
"chat"
],
"model_description": "Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters.Excelling in long-context understanding with a maximum context length of 128K tokens.Supporting 52 major programming languages, including popular ones such as Java, Python, JavaScript, and C++.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": 9,
"quantizations": [
"none"
],
"model_hub": "modelscope",
"model_id": "01ai/Yi-Coder-9B-Chat",
"model_revision": "master"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"none"
],
"model_hub": "modelscope",
"model_id": "01ai/Yi-Coder-1.5B-Chat",
"model_revision": "master"
}
],
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>' + '\n' }}{% endif %}{% endfor %}",
"stop_token_ids": [
1,
2,
6,
7
],
"stop": [
"<|startoftext|>",
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>"
]
},
{
"version": 1,
"context_length": 131072,
"model_name": "yi-coder",
"model_lang": [
"en"
],
"model_ability": [
"generate"
],
"model_description": "Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters.Excelling in long-context understanding with a maximum context length of 128K tokens.Supporting 52 major programming languages, including popular ones such as Java, Python, JavaScript, and C++.",
"model_specs": [
{
"model_format": "pytorch",
"model_size_in_billions": 9,
"quantizations": [
"none"
],
"model_hub": "modelscope",
"model_id": "01ai/Yi-Coder-9B",
"model_revision": "master"
},
{
"model_format": "pytorch",
"model_size_in_billions": "1_5",
"quantizations": [
"none"
],
"model_hub": "modelscope",
"model_id": "01ai/Yi-Coder-1.5B",
"model_revision": "master"
}
]
}
]
2 changes: 2 additions & 0 deletions xinference/model/llm/vllm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class VLLMGenerateConfig(TypedDict, total=False):
"code-llama-python",
"deepseek",
"deepseek-coder",
"yi-coder",
]
VLLM_SUPPORTED_CHAT_MODELS = [
"llama-2-chat",
Expand All @@ -130,6 +131,7 @@ class VLLMGenerateConfig(TypedDict, total=False):
"codegeex4",
"deepseek-chat",
"deepseek-coder-instruct",
"yi-coder-chat",
]
if VLLM_INSTALLED and vllm.__version__ >= "0.3.0":
VLLM_SUPPORTED_CHAT_MODELS.append("qwen1.5-chat")
Expand Down
Loading