diff --git a/CHANGELOG.md b/CHANGELOG.md index 6017812bb..88b9a1b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.13] + +- feat: Update llama.cpp to ggerganov/llama.cpp@ +- fix: Better chat format for Qwen2.5-VL by @alcoftTAO in #2040 + ## [0.3.12] - feat: Update llama.cpp to ggerganov/llama.cpp@a0374a67e2924f2e845cdc59dd67d9a44065a89c diff --git a/llama_cpp/__init__.py b/llama_cpp/__init__.py index b16bb7dc9..0c869dcae 100644 --- a/llama_cpp/__init__.py +++ b/llama_cpp/__init__.py @@ -1,4 +1,4 @@ from .llama_cpp import * from .llama import * -__version__ = "0.3.12" +__version__ = "0.3.13" diff --git a/llama_cpp/llama_chat_format.py b/llama_cpp/llama_chat_format.py index a288db7b0..2a7d575ce 100644 --- a/llama_cpp/llama_chat_format.py +++ b/llama_cpp/llama_chat_format.py @@ -3459,26 +3459,29 @@ class Qwen25VLChatHandler(Llava15ChatHandler): DEFAULT_SYSTEM_MESSAGE = "You are a helpful assistant." CHAT_FORMAT = ( - "<|im_start|>system\n" - "You are a helpful assistant.<|im_end|>\n" + #"{% set image_count = namespace(value=0) %}" + #"{% set video_count = namespace(value=0) %}" "{% for message in messages %}" - "{% if message['role'] == 'user' %}" - "<|im_start|>user\n" + "{% if loop.first and message['role'] != 'system' %}" + "<|im_start|>system\n" + "{{ self.DEFAULT_SYSTEM_MESSAGE }}<|im_end|>\n" + "{% endif %}" + "<|im_start|>{{ message['role'] }}\n" "{% if message['content'] is string %}" - "{{ message['content'] }}" + "{{ message['content'] }}<|im_end|>\n" "{% else %}" "{% for content in message['content'] %}" - "{% if content['type'] == 'text' %}" - "{{ content['text'] }}" - "{% elif content['type'] == 'image_url' %}" + "{% if content['type'] == 'image_url' %}" "{% if content.image_url is string %}" "{{ content.image_url }}" "{% else %}" "{{ content.image_url.url }}" "{% endif %}" + #"{% set image_count.value = image_count.value + 1 %}" + "{% elif content['type'] == 'text' %}" + "{{ content['text'] }}" "{% endif %}" "{% endfor %}" - "{% endif %}" "<|im_end|>\n" "{% endif %}" "{% endfor %}" diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index d13d60458..bd8e36b79 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -200,6 +200,7 @@ """RWKV tokenizer based on greedy tokenization""" +# NOTE: Deprecated and will be removed in the future. (already gone in llama.cpp) # // pre-tokenization types # enum llama_vocab_pre_type { # LLAMA_VOCAB_PRE_TYPE_DEFAULT = 0, diff --git a/vendor/llama.cpp b/vendor/llama.cpp index a0374a67e..bdca38376 160000 --- a/vendor/llama.cpp +++ b/vendor/llama.cpp @@ -1 +1 @@ -Subproject commit a0374a67e2924f2e845cdc59dd67d9a44065a89c +Subproject commit bdca38376f7e8dd928defe01ce6a16218a64b040