Spaces:
Running
Running
whisper : zero-initialize some more context variables
Browse files- whisper.cpp +4 -4
whisper.cpp
CHANGED
|
@@ -592,11 +592,11 @@ struct whisper_context {
|
|
| 592 |
|
| 593 |
mutable std::mt19937 rng; // used for sampling at t > 0.0
|
| 594 |
|
| 595 |
-
int lang_id;
|
| 596 |
|
| 597 |
// [EXPERIMENTAL] token-level timestamps data
|
| 598 |
-
int64_t t_beg;
|
| 599 |
-
int64_t t_last;
|
| 600 |
whisper_token tid_last;
|
| 601 |
std::vector<float> energy; // PCM signal energy
|
| 602 |
|
|
@@ -4339,7 +4339,7 @@ int whisper_full_n_segments(struct whisper_context * ctx) {
|
|
| 4339 |
}
|
| 4340 |
|
| 4341 |
int whisper_full_lang_id(struct whisper_context * ctx) {
|
| 4342 |
-
return ctx->lang_id;
|
| 4343 |
}
|
| 4344 |
|
| 4345 |
int64_t whisper_full_get_segment_t0(struct whisper_context * ctx, int i_segment) {
|
|
|
|
| 592 |
|
| 593 |
mutable std::mt19937 rng; // used for sampling at t > 0.0
|
| 594 |
|
| 595 |
+
int lang_id = 0; // english by default
|
| 596 |
|
| 597 |
// [EXPERIMENTAL] token-level timestamps data
|
| 598 |
+
int64_t t_beg = 0;
|
| 599 |
+
int64_t t_last = 0;
|
| 600 |
whisper_token tid_last;
|
| 601 |
std::vector<float> energy; // PCM signal energy
|
| 602 |
|
|
|
|
| 4339 |
}
|
| 4340 |
|
| 4341 |
int whisper_full_lang_id(struct whisper_context * ctx) {
|
| 4342 |
+
return ctx->lang_id;
|
| 4343 |
}
|
| 4344 |
|
| 4345 |
int64_t whisper_full_get_segment_t0(struct whisper_context * ctx, int i_segment) {
|