Skip to content

Commit 7a4de4c

Browse files
committed
fix double-close of fout
1 parent 512705e commit 7a4de4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llama.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4963,7 +4963,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
49634963
gguf_add_tensor(ctx_out, meta);
49644964
}
49654965

4966-
auto fout = llama_file(fname_out.c_str(), "wb");
4966+
llama_file fout(fname_out.c_str(), "wb");
49674967

49684968
const size_t meta_size = gguf_get_meta_size(ctx_out);
49694969

@@ -5020,7 +5020,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
50205020

50215021
auto big_loop = [
50225022
&read_data_pool, &f32_conv_buf_pool, &work_pool, &ml, &quant_tensor_types, &quant_tensor_sizes, params, &pool,
5023-
nthread, &log_mutex, &hist_all, ctx_out, fout, &quant_tensor_offsets
5023+
nthread, &log_mutex, &hist_all, ctx_out, &fout, &quant_tensor_offsets
50245024
](int i, int thread_idx) {
50255025
std::array<int64_t, 1 << 4> hist_cur = {};
50265026
auto & read_data = read_data_pool[thread_idx];

0 commit comments

Comments
 (0)