]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper : fix possible uninitialized variables (#291)
authorGeorgi Gerganov <redacted>
Mon, 16 Jan 2023 19:44:40 +0000 (21:44 +0200)
committerGeorgi Gerganov <redacted>
Mon, 16 Jan 2023 19:44:40 +0000 (21:44 +0200)
whisper.cpp

index 05bf58e16e3f77d0031aa0611e21aec0f5721e06..5aa3be1533bce2abec1a0ae077c5bc873b8dc268 100644 (file)
@@ -3091,10 +3091,10 @@ static std::vector<whisper_token_data> whisper_sample_token_topk(
     std::vector<whisper_token_data> result;
     result.reserve(k);
 
-    whisper_token tid;
+    whisper_token tid = vocab.token_beg;
 
-    float pt;
-    float ptsum;
+    float pt    = 0.0;
+    float ptsum = 0.0;
 
     {
         double sum_ts = 0.0;