diff --git a/modelscope/preprocessors/templates/loader.py b/modelscope/preprocessors/templates/loader.py index 0d97ecf4..08eda1e5 100644 --- a/modelscope/preprocessors/templates/loader.py +++ b/modelscope/preprocessors/templates/loader.py @@ -197,6 +197,13 @@ template_info = [ modelfile_prefix= 'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/codegemma', ), + TemplateInfo( + template=TemplateType.gemma, + template_regex= + f'{no("pali")}.*{cases("gemma3", "gemma-3")}.*', + modelfile_prefix= + 'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/gemma3', + ), TemplateInfo( template=TemplateType.gemma, template_regex= @@ -496,6 +503,13 @@ template_info = [ 'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/command-r', ), + TemplateInfo( + template_regex= + f'.*{cases("command-a")}.*', + modelfile_prefix= + 'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/command-a', + ), + # codegeex TemplateInfo( template=TemplateType.codegeex4, diff --git a/tests/tools/test_to_ollama.py b/tests/tools/test_to_ollama.py index a7f8275d..501e71c4 100644 --- a/tests/tools/test_to_ollama.py +++ b/tests/tools/test_to_ollama.py @@ -122,6 +122,14 @@ 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( + 'lmstudio-community/c4ai-command-a-03-2025-GGUF', + 'command-a', + gguf_meta={'general.name': 'C4Ai Command A 03 2025'}) + _test_check_tmpl_type( + 'unsloth/gemma-3-27b-it-GGUF', + 'gemma3', + gguf_meta={'general.name': 'Gemma-3-27B-It'}) _test_check_tmpl_type( 'DevQuasar/CohereForAI.c4ai-command-r7b-arabic-02-2025-GGUF', 'command-r7b-arabic',