Commit b705d233 authored by mayong's avatar mayong
Browse files

update files.

parent 5cacbb67
......@@ -13,5 +13,5 @@ class Model {
virtual std::string rescoring() = 0;
};
Model *create_model(const char *path);
Model *create_model(const char *path,int nThread=0);
#endif
#include "precomp.h"
Model *create_model(const char *path)
Model *create_model(const char *path,int nThread)
{
Model *mm;
mm = new paraformer::ModelImp(path);
mm = new paraformer::ModelImp(path, nThread);
return mm;
}
......@@ -18,15 +18,17 @@ int main(int argc, char *argv[])
printf("Usage: %s /path/to/model_dir /path/to/wav/file", argv[0]);
exit(-1);
}
Model* mm = create_model(argv[1]);
struct timeval start, end;
gettimeofday(&start, NULL);
int nThreadNum = 8;
Model* mm = create_model(argv[1], nThreadNum);
if (!mm)
{
printf("Cannot load ASR Model from: %s, there must be files model.onnx and vocab.txt", argv[1]);
exit(-1);
}
struct timeval start, end;
Audio audio(0);
if (!audio.loadwav(argv[2]))
{
......@@ -34,7 +36,7 @@ int main(int argc, char *argv[])
return -1;
}
audio.disp();
gettimeofday(&start, NULL);
gettimeofday(&end, NULL);
long seconds = (end.tv_sec - start.tv_sec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment