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 e9d1b8d

Browse filesBrowse files
committed
fallback to get_embeddings_ith
1 parent 1a9b8af commit e9d1b8d
Copy full SHA for e9d1b8d

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,11 @@ def decode_batch(n_seq: int):
821821
self._ctx.ctx, i
822822
)
823823
if not ptr:
824-
raise RuntimeError("Failed to get embeddings from sequence pooling type is not set")
824+
ptr = llama_cpp.llama_get_embeddings_ith(
825+
self._ctx.ctx, i
826+
)
827+
if not ptr:
828+
raise RuntimeError(f"Failed to get embeddings for sequence {i}")
825829
embedding: List[float] = ptr[:n_embd]
826830
if normalize:
827831
norm = float(np.linalg.norm(embedding))

0 commit comments

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