summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcebtenzzre <cebtenzzre@gmail.com>2023-10-07 04:41:52 -0400
committerGitHub <noreply@github.com>2023-10-07 11:41:52 +0300
commitf1782c68de13b64bb5283fc2038f584e47be9fd2 (patch)
treee594da1eedbea9c64739444d50c7dd39d8395057
parentc26765a0a148b47e5b541df32438c3ad2a0a8314 (diff)
quantize : fail fast on write errors (#3521)
-rw-r--r--llama.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llama.cpp b/llama.cpp
index 227cd9d0..d10656bb 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);