We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bca9653 commit 42bb721Copy full SHA for 42bb721
llama_cpp/llama.py
@@ -839,9 +839,10 @@ def create_embedding(
839
An embedding object.
840
"""
841
assert self.ctx is not None
842
+ assert self.model is not None
843
model_name: str = model if model is not None else self.model_path
844
- if self.model_params.embedding == False:
845
+ if self.context_params.embedding == False:
846
raise RuntimeError(
847
"Llama model must be created with embedding=True to call this method"
848
)
@@ -863,7 +864,7 @@ def create_embedding(
863
864
n_tokens = len(tokens)
865
total_tokens += n_tokens
866
embedding = llama_cpp.llama_get_embeddings(self.ctx)[
- : llama_cpp.llama_n_embd(self.ctx)
867
+ : llama_cpp.llama_n_embd(self.model)
868
]
869
870
data.append(
0 commit comments