]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
quantize : fail fast on write errors (#3521)
authorcebtenzzre <redacted>
Sat, 7 Oct 2023 08:41:52 +0000 (04:41 -0400)
committerGitHub <redacted>
Sat, 7 Oct 2023 08:41:52 +0000 (11:41 +0300)
llama.cpp

index 227cd9d0378481f425cf0cd6e8c75150078bd644..d10656bb801db017656ddd21311f50b8d6726b8e 100644 (file)
--- 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);