check am.mvn exists

This commit is contained in:
lyblsgo 2023-04-25 20:34:53 +08:00
parent 1d205d340f
commit 6ef5ccc784
2 changed files with 5 additions and 1 deletions

View File

@ -144,7 +144,7 @@ int main(int argc, char *argv[])
if(model_path.find(WAV_SCP)!=model_path.end()){
ifstream in(model_path.at(WAV_SCP));
if (!in.is_open()) {
LOG(ERROR) << ("Failed to open file: %s", model_path.at(WAV_SCP));
LOG(ERROR) << "Failed to open file: " << model_path.at(WAV_SCP);
return 0;
}
string line;

View File

@ -147,6 +147,10 @@ vector<float> Paraformer::FbankKaldi(float sample_rate, const float* waves, int
void Paraformer::LoadCmvn(const char *filename)
{
ifstream cmvn_stream(filename);
if (!cmvn_stream.is_open()) {
LOG(ERROR) << "Failed to open file: " << filename;
exit(0);
}
string line;
while (getline(cmvn_stream, line)) {