Replies: 21 comments 47 replies
-
Can't seem to get the app to transcribe just yet - something I'm doing wrong here? Thanks |
Beta Was this translation helpful? Give feedback.
-
Hello Everybody, First of all thank you very much for all the work that was poured into this. I created my build folder with all executables. github.com/ggerganov/whisper.cpp/bindings/go Any advice/piece of help is very much appreciated. |
Beta Was this translation helpful? Give feedback.
-
When running the command from the makefile everything works fine. github.com/ggerganov/whisper.cpp/bindings/go/var/folders/y0/dbsx2zd55lz31wt__nmdgm840000gn/T/go-build1048629891/b084/params.cover.go:11:10: fatal error: 'whisper.h' file not found |
Beta Was this translation helpful? Give feedback.
-
Golang bindings are 45 times slower than the C++ binary when transcoding
C++ and Golang examples are compiled following the readme. I haven't profiled the Golang bindings yet. Raw resultsC++ binarytime ./main -m ./models/ggml-tiny.en.bin -f ./samples/jfk.wav
whisper_init_from_file: loading model from './models/ggml-tiny.en.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab = 51864
whisper_model_load: n_audio_ctx = 1500
whisper_model_load: n_audio_state = 384
whisper_model_load: n_audio_head = 6
whisper_model_load: n_audio_layer = 4
whisper_model_load: n_text_ctx = 448
whisper_model_load: n_text_state = 384
whisper_model_load: n_text_head = 6
whisper_model_load: n_text_layer = 4
whisper_model_load: n_mels = 80
whisper_model_load: f16 = 1
whisper_model_load: type = 1
whisper_model_load: mem required = 387.00 MB (+ 3.00 MB per decoder)
whisper_model_load: kv self size = 2.62 MB
whisper_model_load: kv cross size = 8.79 MB
whisper_model_load: adding 1607 extra tokens
whisper_model_load: model ctx = 73.58 MB
whisper_model_load: model size = 73.54 MB
system_info: n_threads = 4 / 16 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |
main: processing './samples/jfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, timestamps = 1 ...
[00:00:00.000 --> 00:00:07.740] And so my fellow Americans ask not what your country can do for you
[00:00:07.740 --> 00:00:10.740] ask what you can do for your country
whisper_print_timings: load time = 186.77 ms
whisper_print_timings: mel time = 83.82 ms
whisper_print_timings: sample time = 16.98 ms
whisper_print_timings: encode time = 791.23 ms / 197.81 ms per layer
whisper_print_timings: decode time = 289.46 ms / 72.36 ms per layer
whisper_print_timings: total time = 1374.19 ms
real 0m1.428s
user 0m4.208s
sys 0m0.280s Golang bindingstime ./build/go-whisper -model ./models/ggml-tiny.en.bin samples/jfk.wav
whisper_init_from_file: loading model from './models/ggml-tiny.en.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab = 51864
whisper_model_load: n_audio_ctx = 1500
whisper_model_load: n_audio_state = 384
whisper_model_load: n_audio_head = 6
whisper_model_load: n_audio_layer = 4
whisper_model_load: n_text_ctx = 448
whisper_model_load: n_text_state = 384
whisper_model_load: n_text_head = 6
whisper_model_load: n_text_layer = 4
whisper_model_load: n_mels = 80
whisper_model_load: f16 = 1
whisper_model_load: type = 1
whisper_model_load: mem required = 387.00 MB (+ 3.00 MB per decoder)
whisper_model_load: kv self size = 2.62 MB
whisper_model_load: kv cross size = 8.79 MB
whisper_model_load: adding 1607 extra tokens
whisper_model_load: model ctx = 73.58 MB
whisper_model_load: model size = 73.54 MB
Loading "./samples/jfk.wav"
...processing "./samples/jfk.wav"
[ 0s-> 7.74s] And so my fellow Americans ask not what your country can do for you
[ 7.74s->10.74s] ask what you can do for your country
real 1m3.919s
user 4m7.851s
sys 0m6.771s Related issue: #421 |
Beta Was this translation helpful? Give feedback.
-
Can we reuse the same model instance to process multiple wav files which are in different languages?I have 20 wav files which are in different languages and totally unrelated. I create one model using a multi-lang model, and then create a new Context using So my question is - are we supposedly to reuse one model and just create a new context for each new wav file? My understanding is that the model inference is somewhat stateful - would the first wav file / context influence the second wav file /context in some way? Btw thanks for building such a great project! |
Beta Was this translation helpful? Give feedback.
-
I'm right that we can't do something like this for i := 0; i < 10; i++{
go func(){ // new goroutine
ctx := whisper.NewContext()
ctx.Process(...)
}()
} I'm having a data race error right now. |
Beta Was this translation helpful? Give feedback.
-
Any qualms against including pre-compiled static libraries for the go bindings (if not more?). The https://github.com/rogchap/v8go is a nice demonstration of how doing prevents having to worry about the c toolchain and the library can effectively be treated as a native go library. See https://github.com/rogchap/v8go/blob/master/cgo.go and https://github.com/rogchap/v8go/blob/master/.github/workflows/v8build.yml for how they build those static libraries. |
Beta Was this translation helpful? Give feedback.
-
I've done similar to what your saying here.
https://github.com/jaybinks/goConstmeWhisper
And yea, I kinda agree.
This allows you to simply download a binary .so of whisper without being
required to build it yourself.
That being said, it's also not super feasible since your going to get a
very unoptimized whisper library
…On Sun, 25 June 2023, 9:00 am Travis Cline, ***@***.***> wrote:
Any qualms against including pre-compiled libraries for the go bindings
(if not more?). The https://github.com/rogchap/v8go is a nice
demonstration of how doing prevents having to worry about the c toolchain
and the library can effectively be treated as a native go library.
See https://github.com/rogchap/v8go/blob/master/cgo.go and
https://github.com/rogchap/v8go/blob/master/.github/workflows/v8build.yml
for how they build those binaries.
—
Reply to this email directly, view it on GitHub
<#312 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQR67V4XJG7HTBBHL6GUDXM5WRBANCNFSM6AAAAAATG4MHKQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
That doesn't seem to match my definition of 'infeasible' -- can you elaborate? |
Beta Was this translation helpful? Give feedback.
-
It would be interesting to see how your performance observations scale with
much longer audio durations.
or, simply looping over the same audio multiple times after loading the
model etc.
My gut says the difference must be memory copies vs pointers or something
like this.
…On Thu, 29 Jun 2023 at 03:11, Bill Mill ***@***.***> wrote:
I made three samples and tested their performance on MLK's full "I have a
dream" speech:
- binding libwhisper.so directly and using cgo: 24s
- using the "low-level" bindings: 31s
- using the "high-level" bindings: 55s
So there's a significant cost to using either of the official bindings.
I'm not sure where the cost comes in on the low-level bindings, because my
cgo looks extremely similar to what it's doing, but it's repeatably much
faster.
All programs are available here
<https://github.com/llimllib/blisper/tree/abad02796b6edd51fb01a9e529a46fd4420b6d85>
(I've linked directly to the version I used for these tests)
—
Reply to this email directly, view it on GitHub
<#312 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQR6YIEVHHHBRGH3QUCFDXNRQVTANCNFSM6AAAAAATG4MHKQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Sincerely
Jay
|
Beta Was this translation helpful? Give feedback.
-
I had read that the go > boundary was a choke point , but never in my
wildest dreams did I ever consider it was THIS bad.
WOW .
Just for kicks, how does your sotest / lltest compare against the native C
CLI app on the same file / system / settings ??
…On Fri, 30 Jun 2023 at 05:44, Bill Mill ***@***.***> wrote:
For kicks, I edited the bindings to remove the progress callbacks on the
theory that that caused frequent calls across the go -> C boundary, and
that dropped the time for the low-level bindings to 14:19 from 62:28 -
pretty conclusive evidence that they are a major issue.
Here's the diff:
--- whisper.go 2023-06-26 08:49:04+++ whisper.2.go 2023-06-29 15:43:00@@ -326,10 +326,10 @@
// It seems this approach can offer some speedup in some cases.
// However, the transcription accuracy can be worse at the beginning and end of each chunk.
func (ctx *Context) Whisper_full_parallel(params Params, samples []float32, processors int, encoderBeginCallback func() bool, newSegmentCallback func(int)) error {- registerEncoderBeginCallback(ctx, encoderBeginCallback)- registerNewSegmentCallback(ctx, newSegmentCallback)- defer registerEncoderBeginCallback(ctx, nil)- defer registerNewSegmentCallback(ctx, nil)+ // registerEncoderBeginCallback(ctx, encoderBeginCallback)+ // registerNewSegmentCallback(ctx, newSegmentCallback)+ // defer registerEncoderBeginCallback(ctx, nil)+ // defer registerNewSegmentCallback(ctx, nil)
if C.whisper_full_parallel((*C.struct_whisper_context)(ctx), (C.struct_whisper_full_params)(params), (*C.float)(&samples[0]), C.int(len(samples)), C.int(processors)) == 0 {
return nil
—
Reply to this email directly, view it on GitHub
<#312 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQR62BBVO76TAOQ4RFJ4DXNXLJZANCNFSM6AAAAAATG4MHKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Sincerely
Jay
|
Beta Was this translation helpful? Give feedback.
-
When I use
I have seen the same query raised by someone. issue#597. I also tried removing Can you please tell me how I should resolve this issue as I want to bind in my own Golang package. It asks me to compile Could this error be due to the low version of my Mac system? I'm using an Intel Core i7 processor and version 12.6.3. If so, I'll update my system (it's slow to update and I want to make sure it's not the system version first) |
Beta Was this translation helpful? Give feedback.
-
Could you please tell me how to use flags?
`Loading "--language" system_info: n_threads = 8 / 8 | AVX = 0 | AVX2 = 0 | AVX512 = 0 | FMA = 0 | NEON = 1 | ARM_FMA = 1 | METAL = 0 | F16C = 0 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 0 | SSSE3 = 0 | VSX = 0 | COREML = 0 | OPENVINO = 0 | Loading "ru" |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to execute
|
Beta Was this translation helpful? Give feedback.
-
I've created a PR to setup Makefile env vars properly and got my binding running. #1530 |
Beta Was this translation helpful? Give feedback.
-
Has anyone had success building the whisper.cpp library using CUBLAS, OPENBLAS, etc and then using that from a go app? When I use I opened #1553 to ask about this but thought I should drop a comment here as well. |
Beta Was this translation helpful? Give feedback.
-
Hi , does someone has similar issue? I got it run as a container in Kubernetes cluster (intel CPU) but it's very slow. I suspect no hardware acceleration enabled but not sure how to do that. below is my dockerfile. Thanks
|
Beta Was this translation helpful? Give feedback.
-
I have some questions about this golang binding implementation. I made it so far, that I can use the if on the demo files that come with it. Also one other wav-file gets analysed properly, another wav-file is getting analysed as "Musik" :D even tho it i a normal speech. So in general I have some questions:
Does it benefit the tools performance, if this is getting run on an Intel CPU with an iGPU? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Question: C++/C noobie here. Can we also expose the basic stream implementation in the bindings? Or is that not possible for some reason? I saw djthorpe has his own Go implementation that's a bit buggy and hard to get running relative to this. Wondering if we can do without another implementation and only maintain this one stream here! |
Beta Was this translation helpful? Give feedback.
-
Hello trying to follow the Readme but getting this error when I run
Any ideas? |
Beta Was this translation helpful? Give feedback.
-
It seems that go bindings cannot be build using apple clang, but if I use brew version of llvm, I get errors as it is not able to use apple frameworks named in bindings. its M1 mac on macOS 14.4 |
Beta Was this translation helpful? Give feedback.
-
General discussion about the
go
bindings forwhisper.cpp
Current state: bindings/go
Beta Was this translation helpful? Give feedback.
All reactions