MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / encode

Method encode

llama_cpp/_internals.py:334–340  ·  view source on GitHub ↗
(self, batch: LlamaBatch)

Source from the content-addressed store, hash-verified

332 raise RuntimeError(f"llama_decode returned {return_code}")
333
334 def encode(self, batch: LlamaBatch):
335 return_code = llama_cpp.llama_encode(
336 self.ctx,
337 batch.batch,
338 )
339 if return_code != 0:
340 raise RuntimeError(f"llama_encode returned {return_code}")
341
342 def set_n_threads(self, n_threads: int, n_threads_batch: int):
343 llama_cpp.llama_set_n_threads(self.ctx, n_threads, n_threads_batch)

Callers 15

__init__Method · 0.45
embedMethod · 0.45
_create_completionMethod · 0.45
chat_completion_handlerFunction · 0.45
_init_mtmd_contextMethod · 0.45
__call__Method · 0.45
_init_mtmd_contextMethod · 0.45
__call__Method · 0.45
__init__Method · 0.45
add_grammarMethod · 0.45
add_dryMethod · 0.45

Calls

no outgoing calls