|
|
|
@ -2,8 +2,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "ggml.h"
|
|
|
|
#include "ggml.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <fstream>
|
|
|
|
#include <fstream>
|
|
|
|
#include <random>
|
|
|
|
#include <random>
|
|
|
|
@ -417,12 +415,11 @@ static bool llama_model_load(
|
|
|
|
|
|
|
|
|
|
|
|
fin = std::ifstream(fname_part, std::ios::binary);
|
|
|
|
fin = std::ifstream(fname_part, std::ios::binary);
|
|
|
|
fin.rdbuf()->pubsetbuf(f_buf.data(), f_buf.size());
|
|
|
|
fin.rdbuf()->pubsetbuf(f_buf.data(), f_buf.size());
|
|
|
|
fin.seekg(file_offset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// stat the file for file size
|
|
|
|
fin.seekg(0, fin.end);
|
|
|
|
struct stat st;
|
|
|
|
const size_t file_size = fin.tellg();
|
|
|
|
stat(fname_part.c_str(), &st);
|
|
|
|
|
|
|
|
const size_t file_size = st.st_size;
|
|
|
|
fin.seekg(file_offset);
|
|
|
|
|
|
|
|
|
|
|
|
// load weights
|
|
|
|
// load weights
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|