Update convert-llama2c-to-ggml.cpp

removed write_raw and write_u32
This commit is contained in:
m3ndax 2023-08-28 19:21:00 +02:00 committed by GitHub
parent 6b214d1451
commit 78bc8538d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -523,21 +523,6 @@ struct llama_file {
return std::string(chars.data(), len); return std::string(chars.data(), len);
} }
void write_raw(const void * ptr, size_t size) const {
if (size == 0) {
return;
}
errno = 0;
size_t ret = std::fwrite(ptr, size, 1, fp);
if (ret != 1) {
throw std::runtime_error(format("write error: %s", strerror(errno)));
}
}
void write_u32(std::uint32_t val) const {
write_raw(&val, sizeof(val));
}
~llama_file() { ~llama_file() {
if (fp) { if (fp) {
std::fclose(fp); std::fclose(fp);