Skip to content

Commit 2ad156c

Browse files
committed
fix free + swift
1 parent 8795d1d commit 2ad156c

File tree

4 files changed

+1
-5
lines changed

4 files changed

+1
-5
lines changed

examples/batched.swift/Sources/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ let t_main_end = ggml_time_us()
214214

215215
print("decoded \(n_decode) tokens in \(String(format: "%.2f", Double(t_main_end - t_main_start) / 1_000_000.0)) s, speed: \(String(format: "%.2f", Double(n_decode) / (Double(t_main_end - t_main_start) / 1_000_000.0))) t/s\n")
216216

217-
llama_print_timings(context, smpl, nil)
217+
llama_print_timings(context, smpl)
218218

219219
private func tokenize(text: String, add_bos: Bool) -> [llama_token] {
220220
let utf8Count = text.utf8.count

examples/parallel/parallel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static std::vector<std::string> k_prompts = {
5151
struct client {
5252
~client() {
5353
if (ctx_sampling) {
54-
llama_sampling_free(ctx_sampling->smpl);
5554
llama_sampling_free(ctx_sampling);
5655
}
5756
}

examples/server/server.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ struct server_context {
663663
// Clear any sampling context
664664
for (server_slot & slot : slots) {
665665
if (slot.ctx_sampling != nullptr) {
666-
llama_sampling_free(slot.ctx_sampling->smpl);
667666
llama_sampling_free(slot.ctx_sampling);
668667
}
669668
}
@@ -1088,7 +1087,6 @@ struct server_context {
10881087

10891088
{
10901089
if (slot.ctx_sampling != nullptr) {
1091-
llama_sampling_free(slot.ctx_sampling->smpl);
10921090
llama_sampling_free(slot.ctx_sampling);
10931091
}
10941092

examples/speculative/speculative.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ int main(int argc, char ** argv) {
600600

601601
llama_sampling_free(ctx_sampling);
602602
for (int s = 0; s < n_seq_dft; ++s) {
603-
llama_sampling_free(drafts[s].ctx_sampling->smpl);
604603
llama_sampling_free(drafts[s].ctx_sampling);
605604
}
606605

0 commit comments

Comments
 (0)