Fix bin file seek offset

This commit is contained in:
2024-04-20 21:30:01 +02:00
parent 5e663b9029
commit 9c5d853b75
2 changed files with 5 additions and 6 deletions

View File

@@ -110,7 +110,7 @@ void Model::loadWeights(const std::string& path) {
for (const auto& tensorInfo : tensorInfos) {
std::vector<float> values(tensorInfo.size);
file.seekg(tensorInfo.offset);
file.seekg(sizeof(int64_t) + header.size() + tensorInfo.offset);
file.read(reinterpret_cast<char*>(values.data()), tensorInfo.size * sizeof(float));
if (layerMap.find(tensorInfo.name) != layerMap.end()) {