(self, batch: LlamaBatch)
| 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) |
no outgoing calls