Remove single file deployment for streaming instantiation and smaller size.

This commit is contained in:
msqr1
2024-08-28 19:15:56 -07:00
parent 01068a2c6c
commit 0166c153bd
20 changed files with 87 additions and 86 deletions

View File

@@ -1,9 +1,9 @@
#include "CommonModel.h"
CommonModel::CommonModel(int index, bool normalMdl, std::string storepath, std::string id, int tarStart, int tarSize) :
normalMdl{normalMdl}, index{index},
storepath{std::move(storepath)},
id{std::move(id)}
CommonModel::CommonModel(int index, bool normalMdl, std::string storepath, std::string id, int tarStart, int tarSize) :
normalMdl{normalMdl}, index{index},
storepath{std::move(storepath)},
id{std::move(id)}
{
globalPool.exec([this, tarStart, tarSize]{
extractAndLoad(reinterpret_cast<unsigned char*>(tarStart), tarSize);
@@ -22,12 +22,12 @@ void CommonModel::extractAndLoad(unsigned char* tar, int tarSize) {
case FailedOpen:
fireEv(index, "Untar: Unable to open file for write");
return;
case FailedWrite:
case FailedWrite:
fireEv(index, "Untar: Unable to write file");
return;
case FailedClose:
fireEv(index, "Untar: Unable to close file after write");
return;
return;
};
if(normalMdl) mdl = vosk_model_new(storepath.c_str());
else mdl = vosk_spk_model_new(storepath.c_str());