Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Askars
2024-02-20 14:47:53 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-02-20 20:47:53 +0800
Commit
763a51486ed1aa58c3808e9438832e6cb3c510d2
763a5148
1 parent
12e52254
Add missing start_time to python API (#591)
Co-authored-by: vsd-vector <askars.salimbajevs@tilde.lv>
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
6 行增加
和
0 行删除
sherpa-onnx/python/csrc/online-recognizer.cc
sherpa-onnx/python/sherpa_onnx/online_recognizer.py
sherpa-onnx/python/csrc/online-recognizer.cc
查看文件 @
763a514
...
...
@@ -24,6 +24,9 @@ static void PybindOnlineRecognizerResult(py::module *m) {
"tokens"
,
[](
PyClass
&
self
)
->
std
::
vector
<
std
::
string
>
{
return
self
.
tokens
;
})
.
def_property_readonly
(
"start_time"
,
[](
PyClass
&
self
)
->
float
{
return
self
.
start_time
;
})
.
def_property_readonly
(
"timestamps"
,
[](
PyClass
&
self
)
->
std
::
vector
<
float
>
{
return
self
.
timestamps
;
});
}
...
...
sherpa-onnx/python/sherpa_onnx/online_recognizer.py
查看文件 @
763a514
...
...
@@ -509,6 +509,9 @@ class OnlineRecognizer(object):
def
timestamps
(
self
,
s
:
OnlineStream
)
->
List
[
float
]:
return
self
.
recognizer
.
get_result
(
s
)
.
timestamps
def
start_time
(
self
,
s
:
OnlineStream
)
->
float
:
return
self
.
recognizer
.
get_result
(
s
)
.
start_time
def
is_endpoint
(
self
,
s
:
OnlineStream
)
->
bool
:
return
self
.
recognizer
.
is_endpoint
(
s
)
...
...
请
注册
或
登录
后发表评论