You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi folks. for a week i've been dabbling with cpp for the first time since school because i wanted to make the server in the examples capable of streaming transcribed segments instead of having to wait for the entire thing. i wanted to leverage the new_segment_callback and got quite far but it seems i cannot figure out some pointer and/or memory management-related stuff.
i wrote a transcriber class which launches in a detached thread. it gets added to the new_segment_callback_user_data to be able to send a segment back to the transcriber which adds it to it's std::queue and then takes it off the queue and writes it to httplib's DataSink instance which you get by using httplib::Response::set_chunked_content_provider().
it works for the first segment but crashes during the second:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
hi folks. for a week i've been dabbling with cpp for the first time since school because i wanted to make the server in the examples capable of streaming transcribed segments instead of having to wait for the entire thing. i wanted to leverage the
new_segment_callback
and got quite far but it seems i cannot figure out some pointer and/or memory management-related stuff.i wrote a transcriber class which launches in a detached thread. it gets added to the
new_segment_callback_user_data
to be able to send a segment back to the transcriber which adds it to it'sstd::queue
and then takes it off the queue and writes it tohttplib
'sDataSink
instance which you get by usinghttplib::Response::set_chunked_content_provider()
.it works for the first segment but crashes during the second:
crash:
i can't figure out what's wrong with the mutex. must be some threading/scoping issue. maybe somebody with actual experience wants to help me out...
code: https://github.com/glaszig/whisper.cpp/tree/server-streaming
diff: https://github.com/ggml-org/whisper.cpp/compare/master...glaszig:server-streaming?expand=1
Beta Was this translation helpful? Give feedback.
All reactions