Skip to content

Commit

Permalink
fix free + swift
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jul 26, 2024
1 parent 8795d1d commit 2ad156c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion examples/batched.swift/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ let t_main_end = ggml_time_us()

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")

llama_print_timings(context, smpl, nil)
llama_print_timings(context, smpl)

private func tokenize(text: String, add_bos: Bool) -> [llama_token] {
let utf8Count = text.utf8.count
Expand Down
1 change: 0 additions & 1 deletion examples/parallel/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static std::vector<std::string> k_prompts = {
struct client {
~client() {
if (ctx_sampling) {
llama_sampling_free(ctx_sampling->smpl);
llama_sampling_free(ctx_sampling);
}
}
Expand Down
2 changes: 0 additions & 2 deletions examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ struct server_context {
// Clear any sampling context
for (server_slot & slot : slots) {
if (slot.ctx_sampling != nullptr) {
llama_sampling_free(slot.ctx_sampling->smpl);
llama_sampling_free(slot.ctx_sampling);
}
}
Expand Down Expand Up @@ -1088,7 +1087,6 @@ struct server_context {

{
if (slot.ctx_sampling != nullptr) {
llama_sampling_free(slot.ctx_sampling->smpl);
llama_sampling_free(slot.ctx_sampling);
}

Expand Down
1 change: 0 additions & 1 deletion examples/speculative/speculative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ int main(int argc, char ** argv) {

llama_sampling_free(ctx_sampling);
for (int s = 0; s < n_seq_dft; ++s) {
llama_sampling_free(drafts[s].ctx_sampling->smpl);
llama_sampling_free(drafts[s].ctx_sampling);
}

Expand Down

0 comments on commit 2ad156c

Please sign in to comment.