MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / close

Method close

examples/server/server.py:1389–1396  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1387 llama_cpp.llama_sampler_reset(self._samplers[seq_id])
1388
1389 def close(self) -> None:
1390 self.set_target_processing_enabled(False)
1391 self.batch.token = ctypes.POINTER(llama_cpp.llama_token)()
1392 llama_cpp.llama_batch_free(self.batch)
1393 llama_cpp.llama_free(self.ctx)
1394 for sampler in self._samplers:
1395 llama_cpp.llama_sampler_free(sampler)
1396 self._samplers.clear()
1397
1398 def set_target_processing_enabled(self, enabled: bool) -> None:
1399 if self.target_processing_enabled == enabled:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected