]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
quantize : fix load vocab crash when len is 128 (#1160)
authorJhen-Jie Hong <redacted>
Sun, 6 Aug 2023 08:04:42 +0000 (16:04 +0800)
committerGitHub <redacted>
Sun, 6 Aug 2023 08:04:42 +0000 (11:04 +0300)
* quantize : fix load vocab crash when len is 128

* ci : add quantize job

.github/workflows/build.yml
examples/quantize/quantize.cpp

index 38fc8814643bd228a2a456dd205bef92b49a06fc..dc3730b2d71861686a5c1423097a1ac9c5cdfaae 100644 (file)
@@ -426,6 +426,19 @@ jobs:
           name: whispercpp.jar
           path: bindings/java/build/libs/whispercpp-*.jar
 
+  quantize:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone
+        uses: actions/checkout@v3
+
+      - name: Test quantize
+        run: |
+          ./models/download-ggml-model.sh tiny.en
+          make quantize
+          ./quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
+
 #      - name: Publish package
 #        if: ${{ github.ref == 'refs/heads/master' }}
 #        uses: gradle/gradle-build-action@v2
index 64e8f35c3863a6be0cfee2211c8be922f95699a7..b01d61431086eaab0fcdd73418e95077fa4750b6 100644 (file)
@@ -138,7 +138,7 @@ bool whisper_model_quantize(const std::string & fname_inp, const std::string & f
         //    return false;
         //}
 
-        char word[128];
+        char word[129];
 
         for (int i = 0; i < n_vocab; i++) {
             uint32_t len;