ollama template: qwen3-coder, gemma3n, mistral-small3.2, magistral, devstral (#1434)

Co-authored-by: suluyan <suluyan.sly@aliabab-inc.com>
This commit is contained in:
suluyana
2025-08-04 17:07:06 +08:00
committed by GitHub
parent b537efebed
commit b3d24d18e6
2 changed files with 53 additions and 0 deletions

View File

@@ -208,6 +208,12 @@ template_info = [
),
# qwen
TemplateInfo(
template_regex=f'.*{cases("qwen3")}.*{cases("coder")}.*',
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/qwen3-coder',
allow_general_name=False,
),
TemplateInfo(
template_regex=f'.*{cases("qwen3")}{no_multi_modal()}.*',
modelfile_prefix=
@@ -255,6 +261,13 @@ template_info = [
),
# gemma
TemplateInfo(
template=TemplateType.gemma,
template_regex=
f'{no("pali")}.*{cases("gemma")}.*{cases("3n")}.*',
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/gemma3n',
),
TemplateInfo(
template_regex=
f'.*{cases("codegemma")}.*',
@@ -365,6 +378,12 @@ template_info = [
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/yarn-mistral',
),
TemplateInfo(
template_regex=
f'.*{cases("mistral")}.*{cases("small3.2", "small-3.2")}.*',
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/mistral-small3.2',
),
TemplateInfo(
template_regex=
f'.*{cases("mistral")}.*{cases("small3.1", "small-3.1")}.*',
@@ -595,6 +614,22 @@ template_info = [
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/wizardlm',
),
# magistral
TemplateInfo(
template_regex=
f'.*{cases("magistral")}.*',
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/magistral',
),
# devstral
TemplateInfo(
template_regex=
f'.*{cases("devstral")}.*',
modelfile_prefix=
'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/devstral',
),
# vicuna
TemplateInfo(
template_regex=

View File

@@ -122,6 +122,24 @@ class TestToOllama(unittest.TestCase):
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_check_template_type(self):
_test_check_tmpl_type('unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF',
'qwen3-coder')
_test_check_tmpl_type(
'unsloth/gemma-3n-E4B-it-GGUF',
'gemma3n',
gguf_meta={'general.name': 'Gemma-3N-E4B-It'})
_test_check_tmpl_type(
'unsloth/Mistral-Small-3.2-24B-Instruct-2506-GGUF',
'mistral-small3.2',
gguf_meta={'general.name': 'Mistral-Small-3.2-24B-Instruct-2506'})
_test_check_tmpl_type(
'unsloth/Magistral-Small-2507-GGUF',
'magistral',
gguf_meta={'general.name': 'Magistral-Small-2507'})
_test_check_tmpl_type(
'mistralai/Devstral-Small-2507_gguf',
'devstral',
gguf_meta={'general.name': 'devstral-small-2507'})
_test_check_tmpl_type(
'unsloth/DeepSeek-R1-0528-Qwen3-8B-GGUF',
'deepseek-r1',