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
4521711f
Commit
4521711f
authored
Feb 28, 2023
by
mayong
Browse files
Merge branch 'main' of
https://github.com/RapidAI/RapidASR
# Conflicts: # cpp_onnx/src/paraformer_onnx.cpp
parents
cedd2118
ece73c89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
cpp_onnx/readme.md
cpp_onnx/readme.md
+5
-0
cpp_onnx/src/paraformer_onnx.cpp
cpp_onnx/src/paraformer_onnx.cpp
+9
-0
No files found.
cpp_onnx/readme.md
View file @
4521711f
...
...
@@ -3,6 +3,11 @@
本程序中的预处理及后处理代码,来自于:https://github.com/chenkui164/FastASR
## 演示

## 注意
本程序只支持 采样率16000hz, 位深16bit的
**单声道**
音频。
...
...
cpp_onnx/src/paraformer_onnx.cpp
View file @
4521711f
...
...
@@ -145,13 +145,22 @@ string ModelImp::forward(float* din, int len, int flag)
try
{
auto
outputTensor
=
m_session
->
Run
(
run_option
,
m_szInputNames
.
data
(),
input_onnx
.
data
(),
m_szInputNames
.
size
(),
m_szOutputNames
.
data
(),
m_szOutputNames
.
size
());
<<<<<<<
.
mine
=======
>>>>>>>
.
theirs
std
::
vector
<
int64_t
>
outputShape
=
outputTensor
[
0
].
GetTensorTypeAndShapeInfo
().
GetShape
();
int64_t
outputCount
=
std
::
accumulate
(
outputShape
.
begin
(),
outputShape
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
float
*
floatData
=
outputTensor
[
0
].
GetTensorMutableData
<
float
>
();
auto
encoder_out_lens
=
outputTensor
[
1
].
GetTensorMutableData
<
int64_t
>
();
<<<<<<<
.
mine
=======
>>>>>>>
.
theirs
result
=
greedy_search
(
floatData
,
*
encoder_out_lens
);
}
catch
(...)
...
...
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