Skip to content

Commit 5fff6aa

Browse files
committed
Fixed sampler chain not being freed
1 parent cb7b05c commit 5fff6aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/llama-cpp-swift/LLama.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public actor LLama {
2424
llama_sampler_chain_add(self.sampling, llama_sampler_init_dist(1234))
2525
}
2626

27+
deinit {
28+
llama_sampler_free(self.sampling)
29+
}
30+
2731
// MARK: - Inference
2832

2933
/// Generates an asynchronous stream of tokens as strings based on the given prompt.

0 commit comments

Comments
 (0)