Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion llama_cpp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .llama_cpp import *
from .llama import *

__version__ = "0.3.12"
__version__ = "0.3.13"
21 changes: 12 additions & 9 deletions llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}"
Expand Down
1 change: 1 addition & 0 deletions llama_cpp/llama_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion vendor/llama.cpp