Skip to content

Commit 9aa447f

Browse files
committed
fix: rename 'embedding' parameter to 'embeddings' with deprecation warning (#2210)
1 parent ad036a8 commit 9aa447f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

llama_cpp/llama.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
yarn_beta_slow: float = 1.0,
9191
yarn_orig_ctx: int = 0,
9292
logits_all: bool = False,
93-
embedding: bool = False,
93+
embeddings: bool = False,
9494
offload_kqv: bool = True,
9595
flash_attn: bool = False,
9696
op_offload: Optional[bool] = None,
@@ -208,7 +208,7 @@ def __init__(
208208
DeprecationWarning,
209209
stacklevel=2
210210
)
211-
embedding = kwargs.pop('embedding')
211+
embeddings = kwargs.pop('embedding')
212212

213213
self._stack = contextlib.ExitStack()
214214
set_verbose(verbose)
@@ -352,7 +352,7 @@ def __init__(
352352
)
353353
self.context_params.yarn_orig_ctx = yarn_orig_ctx if yarn_orig_ctx != 0 else 0
354354
self._logits_all = logits_all if draft_model is None else True
355-
self.context_params.embeddings = embedding # TODO: Rename to embeddings
355+
self.context_params.embeddings = embeddings
356356
self.context_params.offload_kqv = offload_kqv
357357
self.context_params.flash_attn_type = (
358358
llama_cpp.LLAMA_FLASH_ATTN_TYPE_ENABLED
@@ -407,7 +407,7 @@ def __init__(
407407
self.context_params.n_batch = self.n_batch
408408
self.context_params.n_ubatch = min(self.n_batch, n_ubatch)
409409

410-
if embedding:
410+
if embeddings:
411411
self.context_params.n_seq_max = min(
412412
self.n_batch,
413413
llama_cpp.llama_max_parallel_sequences(),

0 commit comments

Comments
 (0)