@@ -69,33 +69,46 @@ bool WhisperService::process(const float *samples, int sample_count) {
69
69
wparams.prompt_n_tokens = service_params.no_context ? 0 : prompt_tokens.size ();
70
70
71
71
// *** Run the actual inference!!! ***
72
- // if (whisper_full(ctx, wparams, samples, sample_count) != 0) {
73
- if (whisper_full_parallel (ctx, wparams, samples, sample_count,service_params.n_processors ) != 0 ) {
72
+ if (whisper_full (ctx, wparams, samples, sample_count) != 0 ) {
74
73
return false ;
75
74
}
76
-
77
- // Now sure whether n_iter and n_new_line should have ever been there...
78
- // *** SUSPICIOUS what happens by removing them? Are they essential?
79
- // if (!use_vad && (n_iter % n_new_line) == 0) {
80
- if (!audio_params.use_vad ) {
81
- // printf("\n");
82
-
83
- // keep part of the audio for next iteration to try to mitigate word boundary issues
84
- // *** I don't know if we need this...
85
- // pcmf32_old = std::vector<float>(pcmf32.end() - n_samples_keep, pcmf32.end());
86
-
87
- // Add tokens of the last full length segment as the prompt
88
- if (!service_params.no_context ) {
89
- prompt_tokens.clear ();
90
-
91
- const int n_segments = whisper_full_n_segments (ctx);
92
- for (int i = 0 ; i < n_segments; ++i) {
93
- const int token_count = whisper_full_n_tokens (ctx, i);
94
- for (int j = 0 ; j < token_count; ++j) {
95
- prompt_tokens.push_back (whisper_full_get_token_id (ctx, i, j));
96
- }
97
- }
98
- }
99
- }
75
+ // if (whisper_full_parallel(ctx, wparams, samples, sample_count,service_params.n_processors) != 0) {
76
+ // error:ggml_metal_get_buffer: error: buffer is nil
77
+ // return false;
78
+
79
+
80
+ // Now sure whether n_iter and n_new_line should have ever been there...
81
+ // *** SUSPICIOUS what happens by removing them? Are they essential?
82
+ // if (!use_vad && (n_iter % n_new_line) == 0) {
83
+ // if (!audio_params.use_vad) {
84
+ // printf("\n");
85
+
86
+ // keep part of the audio for next iteration to try to mitigate word boundary issues
87
+ // *** I don't know if we need this...
88
+ // pcmf32_old = std::vector<float>(pcmf32.end() - n_samples_keep, pcmf32.end());
89
+
90
+ // Add tokens of the last full length segment as the prompt
91
+ // if (!service_params.no_context) {
92
+ // prompt_tokens.
93
+ //
94
+ // clear();
95
+ //
96
+ // const int n_segments = whisper_full_n_segments(ctx);
97
+ // for (
98
+ // int i = 0;
99
+ // i < n_segments;
100
+ // ++i) {
101
+ // const int token_count = whisper_full_n_tokens(ctx, i);
102
+ // for (
103
+ // int j = 0;
104
+ // j < token_count;
105
+ // ++j) {
106
+ // prompt_tokens.
107
+ // push_back(whisper_full_get_token_id(ctx, i, j)
108
+ // );
109
+ // }
110
+ // }
111
+ // }
112
+ // }
100
113
return true ;
101
114
}
0 commit comments