Spaces:
Running
Running
Sandro Hanea
commited on
whisper : add whisper_full_get_segment_no_speech_prob_from_state (#2716)
Browse files- include/whisper.h +1 -0
- src/whisper.cpp +4 -0
include/whisper.h
CHANGED
|
@@ -667,6 +667,7 @@ extern "C" {
|
|
| 667 |
|
| 668 |
// Get the no_speech probability for the specified segment
|
| 669 |
WHISPER_API float whisper_full_get_segment_no_speech_prob (struct whisper_context * ctx, int i_segment);
|
|
|
|
| 670 |
#ifdef __cplusplus
|
| 671 |
}
|
| 672 |
#endif
|
|
|
|
| 667 |
|
| 668 |
// Get the no_speech probability for the specified segment
|
| 669 |
WHISPER_API float whisper_full_get_segment_no_speech_prob (struct whisper_context * ctx, int i_segment);
|
| 670 |
+
WHISPER_API float whisper_full_get_segment_no_speech_prob_from_state(struct whisper_state * state, int i_segment);
|
| 671 |
#ifdef __cplusplus
|
| 672 |
}
|
| 673 |
#endif
|
src/whisper.cpp
CHANGED
|
@@ -6464,6 +6464,10 @@ float whisper_full_get_segment_no_speech_prob(struct whisper_context * ctx, int
|
|
| 6464 |
return ctx->state->result_all[i_segment].no_speech_prob;
|
| 6465 |
}
|
| 6466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6467 |
// =================================================================================================
|
| 6468 |
|
| 6469 |
//
|
|
|
|
| 6464 |
return ctx->state->result_all[i_segment].no_speech_prob;
|
| 6465 |
}
|
| 6466 |
|
| 6467 |
+
float whisper_full_get_segment_no_speech_prob_from_state(struct whisper_state * state, int i_segment) {
|
| 6468 |
+
return state->result_all[i_segment].no_speech_prob;
|
| 6469 |
+
}
|
| 6470 |
+
|
| 6471 |
// =================================================================================================
|
| 6472 |
|
| 6473 |
//
|