From f1782c68de13b64bb5283fc2038f584e47be9fd2 Mon Sep 17 00:00:00 2001 From: cebtenzzre Date: Sat, 7 Oct 2023 04:41:52 -0400 Subject: [PATCH] quantize : fail fast on write errors (#3521) --- llama.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llama.cpp b/llama.cpp index 227cd9d037848..d10656bb801db 100644 --- a/llama.cpp +++ b/llama.cpp @@ -7194,6 +7194,7 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s } std::ofstream fout(fname_out, std::ios::binary); + fout.exceptions(std::ofstream::failbit); // fail fast on write errors const size_t meta_size = gguf_get_meta_size(ctx_out);