From 7072eb848a441118ee5e13448030e7252b01c417 Mon Sep 17 00:00:00 2001 From: suluyana Date: Thu, 7 Nov 2024 14:25:11 +0800 Subject: [PATCH] feat ollama template: llama3.2-vision --- modelscope/preprocessors/templates/loader.py | 6 ++++++ tests/tools/test_to_ollama.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/modelscope/preprocessors/templates/loader.py b/modelscope/preprocessors/templates/loader.py index ccbd6e09..97145199 100644 --- a/modelscope/preprocessors/templates/loader.py +++ b/modelscope/preprocessors/templates/loader.py @@ -53,6 +53,12 @@ def no_multi_modal(): template_info = [ # llama ## "llama3" + TemplateInfo( + template_regex= + f'.*{cases("llama3.2", "llama-3.2")}.*{cases("vision")}.*', + modelfile_prefix= + 'https://modelscope.oss-cn-beijing.aliyuncs.com/llm_template/ollama/llama3.2-vision', + ), TemplateInfo( template=TemplateType.llama3, template_regex= diff --git a/tests/tools/test_to_ollama.py b/tests/tools/test_to_ollama.py index d64af6dd..6dbb5f75 100644 --- a/tests/tools/test_to_ollama.py +++ b/tests/tools/test_to_ollama.py @@ -121,6 +121,9 @@ 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( + 'AI-ModelScope/Llama-3.2-11B-Vision-Instruct-GGUF', + 'llama3.2-vision') _test_check_tmpl_type('LLM-Research/Meta-Llama-3.2-8B-Instruct-GGUF', 'llama3.2') _test_check_tmpl_type('LLM-Research/Meta-Llama-3.1-8B-Instruct-GGUF',