Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 97d527e

Browse filesBrowse files
committed
feat: Add server chat_format minicpm-v-2.6 for MiniCPMv26ChatHandler
1 parent c68e7fb commit 97d527e
Copy full SHA for 97d527e

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed

‎llama_cpp/server/model.py

Copy file name to clipboardExpand all lines: llama_cpp/server/model.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ def load_llama_from_model_settings(settings: ModelSettings) -> llama_cpp.Llama:
157157
chat_handler = llama_cpp.llama_chat_format.Llama3VisionAlpha(
158158
clip_model_path=settings.clip_model_path, verbose=settings.verbose
159159
)
160+
elif settings.chat_format == "minicpm-v-2.6":
161+
assert settings.clip_model_path is not None, "clip model not found"
162+
if settings.hf_model_repo_id is not None:
163+
chat_handler = (
164+
llama_cpp.llama_chat_format.MiniCPMv26ChatHandler.from_pretrained(
165+
repo_id=settings.hf_model_repo_id,
166+
filename=settings.clip_model_path,
167+
verbose=settings.verbose,
168+
)
169+
)
170+
else:
171+
chat_handler = llama_cpp.llama_chat_format.MiniCPMv26ChatHandler(
172+
clip_model_path=settings.clip_model_path, verbose=settings.verbose
173+
)
160174
elif settings.chat_format == "hf-autotokenizer":
161175
assert (
162176
settings.hf_pretrained_model_name_or_path is not None

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.