浏览代码

quantize : fail fast on write errors (#3521)

cebtenzzre 2 年之前
父节点
当前提交
f1782c68de
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      llama.cpp

+ 1 - 0
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);