-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
May whisper.cpp help ? #63
Comments
yes, but not so simple for now. |
it can be used by calling a dll, but there is no performance improvement when I tried it(cpu: whisper_ctx = whisper_cpp.whisper_init(model_path)
params = whisper_cpp.whisper_full_default_params(0)
params.n_threads = 8
params.language = whisper_cpp.String(b"zh")
audio = load_audio(file_path)
rc = whisper_cpp.whisper_full(
whisper_ctx,
params,
audio.ctypes.data_as(ctypes.POINTER(ctypes.c_float)),
len(audio),
)
if rc != 0:
raise Exception(f"Error from whisper.cpp: {rc}")
n_segments = whisper_cpp.whisper_full_n_segments(whisper_ctx)
result = []
for i in range(n_segments):
t0 = whisper_cpp.whisper_full_get_segment_t0(whisper_ctx, i)
t1 = whisper_cpp.whisper_full_get_segment_t1(whisper_ctx, i)
txt = whisper_cpp.whisper_full_get_segment_text(whisper_ctx, i)
result.append({"start": t0 * 10, "end": t1 * 10, "text": txt.decode()})
whisper_cpp.whisper_free(whisper_ctx) |
https:/abdeladim-s/pywhispercpp has done it |
whisper.cpp may offer an efficient way for inference ?
The text was updated successfully, but these errors were encountered: