]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
main : CSV format export trimmed spaces fix (#444)
authorAlex Bacart <redacted>
Sat, 4 Feb 2023 06:48:35 +0000 (09:48 +0300)
committerGitHub <redacted>
Sat, 4 Feb 2023 06:48:35 +0000 (08:48 +0200)
* Update main.cpp

Removed string trimming

* Update main.cpp

* Update main.cpp

* Revert "Update main.cpp"

This reverts commit d8924fdcfe8a2980db0af47d42ec206fc1a3e9d0.

* Revert "Update main.cpp"

This reverts commit 252e508d8597231c61380ebea42b3707714345cc.

examples/main/main.cpp

index 68f427c704c8127f3b87fb6817899b1227045578..10d6b3c737fec8c82fb1dacff843d1436c504877 100644 (file)
@@ -346,9 +346,6 @@ bool output_csv(struct whisper_context * ctx, const char * fname) {
     const int n_segments = whisper_full_n_segments(ctx);
     for (int i = 0; i < n_segments; ++i) {
         const char * text = whisper_full_get_segment_text(ctx, i);
-        if (text[0] == ' ') {
-            text = text + sizeof(char); //whisper_full_get_segment_text() returns a string with leading space, point to the next character.
-        }
         const int64_t t0 = whisper_full_get_segment_t0(ctx, i);
         const int64_t t1 = whisper_full_get_segment_t1(ctx, i);