Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
RapidASR
Commits
b705d233
Commit
b705d233
authored
Feb 28, 2023
by
mayong
Browse files
update files.
parent
5cacbb67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
cpp_onnx/include/Model.h
cpp_onnx/include/Model.h
+1
-1
cpp_onnx/src/lib/Model.cpp
cpp_onnx/src/lib/Model.cpp
+2
-2
cpp_onnx/tester/tester.cpp
cpp_onnx/tester/tester.cpp
+7
-5
No files found.
cpp_onnx/include/Model.h
View file @
b705d233
...
...
@@ -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
cpp_onnx/src/lib/Model.cpp
View file @
b705d233
#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
;
}
cpp_onnx/tester/tester.cpp
View file @
b705d233
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment