This repository was archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
python GIl issues c++ thread #3
Comments
[{"sentence":"甚至"}] decoder = wenet.StreammingAsrDecoder(model)
# simulating streamming
def send():
# decoder.AcceptWaveform(b, True)
# return
nbytes = int((16000/1000)*2*800)
final = False
r = nbytes
l = 0
while True:
if r == len(b):
final = False
l = 0
r = nbytes
decoder.AcceptWaveform(b[l:r], final)
l = r
if l >= len(b):
break
if r + nbytes < len(b):
r = r + nbytes
else:
r = len(b)
t = threading.Thread(target=send)
t.start()
#send()
#decoder.Reset()
#decoder.Reset()
#send()
for res in decoder.GetInstanceResult():
print(str(res))
t.join() when gil is hold in send thread, these is no chance running "for res in decoder.GetInstanceResult():" |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Uh oh!
There was an error while loading. Please reload this page.
pybind/pybind11#1723
The text was updated successfully, but these errors were encountered: