Skip to content

Commit bc0be00

Browse files
authored
Merge branch 'main' into main
2 parents 1a67961 + e1af05f commit bc0be00

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.14]
11+
12+
- feat: Update llama.cpp to ggerganov/llama.cpp@79e0b68c178656bb0632cb8602d2940b755077f8
13+
14+
## [0.3.13]
15+
16+
- feat: Update llama.cpp to ggerganov/llama.cpp@bdca38376f7e8dd928defe01ce6a16218a64b040
17+
- fix: Better chat format for Qwen2.5-VL by @alcoftTAO in #2040
18+
1019
## [0.3.12]
1120

1221
- feat: Update llama.cpp to ggerganov/llama.cpp@a0374a67e2924f2e845cdc59dd67d9a44065a89c

llama_cpp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .llama_cpp import *
22
from .llama import *
33

4-
__version__ = "0.3.12"
4+
__version__ = "0.3.14"

llama_cpp/llama_chat_format.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3459,26 +3459,29 @@ class Qwen25VLChatHandler(Llava15ChatHandler):
34593459
DEFAULT_SYSTEM_MESSAGE = "You are a helpful assistant."
34603460

34613461
CHAT_FORMAT = (
3462-
"<|im_start|>system\n"
3463-
"You are a helpful assistant.<|im_end|>\n"
3462+
#"{% set image_count = namespace(value=0) %}"
3463+
#"{% set video_count = namespace(value=0) %}"
34643464
"{% for message in messages %}"
3465-
"{% if message['role'] == 'user' %}"
3466-
"<|im_start|>user\n"
3465+
"{% if loop.first and message['role'] != 'system' %}"
3466+
"<|im_start|>system\n"
3467+
"{{ self.DEFAULT_SYSTEM_MESSAGE }}<|im_end|>\n"
3468+
"{% endif %}"
3469+
"<|im_start|>{{ message['role'] }}\n"
34673470
"{% if message['content'] is string %}"
3468-
"{{ message['content'] }}"
3471+
"{{ message['content'] }}<|im_end|>\n"
34693472
"{% else %}"
34703473
"{% for content in message['content'] %}"
3471-
"{% if content['type'] == 'text' %}"
3472-
"{{ content['text'] }}"
3473-
"{% elif content['type'] == 'image_url' %}"
3474+
"{% if content['type'] == 'image_url' %}"
34743475
"{% if content.image_url is string %}"
34753476
"{{ content.image_url }}"
34763477
"{% else %}"
34773478
"{{ content.image_url.url }}"
34783479
"{% endif %}"
3480+
#"{% set image_count.value = image_count.value + 1 %}"
3481+
"{% elif content['type'] == 'text' %}"
3482+
"{{ content['text'] }}"
34793483
"{% endif %}"
34803484
"{% endfor %}"
3481-
"{% endif %}"
34823485
"<|im_end|>\n"
34833486
"{% endif %}"
34843487
"{% endfor %}"

llama_cpp/llama_cpp.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,13 @@
179179

180180

181181
# enum llama_vocab_type {
182-
# LLAMA_VOCAB_TYPE_NONE = 0, // For models without vocab
183-
# LLAMA_VOCAB_TYPE_SPM = 1, // LLaMA tokenizer based on byte-level BPE with byte fallback
184-
# LLAMA_VOCAB_TYPE_BPE = 2, // GPT-2 tokenizer based on byte-level BPE
185-
# LLAMA_VOCAB_TYPE_WPM = 3, // BERT tokenizer based on WordPiece
186-
# LLAMA_VOCAB_TYPE_UGM = 4, // T5 tokenizer based on Unigram
187-
# LLAMA_VOCAB_TYPE_RWKV = 5, // RWKV tokenizer based on greedy tokenization
182+
# LLAMA_VOCAB_TYPE_NONE = 0, // For models without vocab
183+
# LLAMA_VOCAB_TYPE_SPM = 1, // LLaMA tokenizer based on byte-level BPE with byte fallback
184+
# LLAMA_VOCAB_TYPE_BPE = 2, // GPT-2 tokenizer based on byte-level BPE
185+
# LLAMA_VOCAB_TYPE_WPM = 3, // BERT tokenizer based on WordPiece
186+
# LLAMA_VOCAB_TYPE_UGM = 4, // T5 tokenizer based on Unigram
187+
# LLAMA_VOCAB_TYPE_RWKV = 5, // RWKV tokenizer based on greedy tokenization
188+
# LLAMA_VOCAB_TYPE_PLAMO2 = 6, // PLaMo-2 tokenizer based on Aho-Corasick with dynamic programming
188189
# };
189190
LLAMA_VOCAB_TYPE_NONE = 0
190191
"""For models without vocab"""
@@ -198,8 +199,11 @@
198199
"""T5 tokenizer based on Unigram"""
199200
LLAMA_VOCAB_TYPE_RWKV = 5
200201
"""RWKV tokenizer based on greedy tokenization"""
202+
LLAMA_VOCAB_TYPE_PLAMO2 = 6
203+
"""PLaMo-2 tokenizer based on Aho-Corasick with dynamic programming"""
201204

202205

206+
# NOTE: Deprecated and will be removed in the future. (already gone in llama.cpp)
203207
# // pre-tokenization types
204208
# enum llama_vocab_pre_type {
205209
# LLAMA_VOCAB_PRE_TYPE_DEFAULT = 0,
@@ -2170,7 +2174,7 @@ def llama_kv_self_seq_add(
21702174
# // - lazily on next llama_decode()
21712175
# // p0 < 0 : [0, p1]
21722176
# // p1 < 0 : [p0, inf)
2173-
# DEPRECATED(void llama_kv_self_seq_div(
2177+
# DEPRECATED(LLAMA_API void llama_kv_self_seq_div(
21742178
# struct llama_context * ctx,
21752179
# llama_seq_id seq_id,
21762180
# llama_pos p0,

vendor/llama.cpp

0 commit comments

Comments
 (0)