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
Fangjun Kuang
2024-04-08 17:22:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-04-08 17:22:48 +0800
Commit
6b3d2b87f9a780e774400d5065a5d44b73c1a3eb
6b3d2b87
1 parent
6fb8ceda
Fix releasing GIL (#741)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
4 行增加
和
12 行删除
sherpa-onnx/python/csrc/offline-stream.cc
sherpa-onnx/python/csrc/online-stream.cc
sherpa-onnx/python/csrc/offline-stream.cc
查看文件 @
6b3d2b8
...
...
@@ -53,17 +53,8 @@ void PybindOfflineStream(py::module *m) {
py
::
class_
<
PyClass
>
(
*
m
,
"OfflineStream"
)
.
def
(
"accept_waveform"
,
[](
PyClass
&
self
,
float
sample_rate
,
py
::
array_t
<
float
>
waveform
)
{
#if 0
auto report_gil_status = []() {
auto is_gil_held = false;
if (auto tstate = py::detail::get_thread_state_unchecked())
is_gil_held = (tstate == PyGILState_GetThisThreadState());
return is_gil_held ? "GIL held" : "GIL released";
};
std::cout << report_gil_status() << "\n";
#endif
[](
PyClass
&
self
,
float
sample_rate
,
const
std
::
vector
<
float
>
&
waveform
)
{
self
.
AcceptWaveform
(
sample_rate
,
waveform
.
data
(),
waveform
.
size
());
},
py
::
arg
(
"sample_rate"
),
py
::
arg
(
"waveform"
),
kAcceptWaveformUsage
,
...
...
sherpa-onnx/python/csrc/online-stream.cc
查看文件 @
6b3d2b8
...
...
@@ -25,7 +25,8 @@ void PybindOnlineStream(py::module *m) {
py
::
class_
<
PyClass
>
(
*
m
,
"OnlineStream"
)
.
def
(
"accept_waveform"
,
[](
PyClass
&
self
,
float
sample_rate
,
py
::
array_t
<
float
>
waveform
)
{
[](
PyClass
&
self
,
float
sample_rate
,
const
std
::
vector
<
float
>
&
waveform
)
{
self
.
AcceptWaveform
(
sample_rate
,
waveform
.
data
(),
waveform
.
size
());
},
py
::
arg
(
"sample_rate"
),
py
::
arg
(
"waveform"
),
kAcceptWaveformUsage
,
...
...
请
注册
或
登录
后发表评论