jhenhong commited on
Commit
7676245
·
unverified ·
1 Parent(s): 61d4989

quantize : fix load vocab crash when len is 128 (#1160)

Browse files

* quantize : fix load vocab crash when len is 128

* ci : add quantize job

.github/workflows/build.yml CHANGED
@@ -426,6 +426,19 @@ jobs:
426
  name: whispercpp.jar
427
  path: bindings/java/build/libs/whispercpp-*.jar
428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
  # - name: Publish package
430
  # if: ${{ github.ref == 'refs/heads/master' }}
431
  # uses: gradle/gradle-build-action@v2
 
426
  name: whispercpp.jar
427
  path: bindings/java/build/libs/whispercpp-*.jar
428
 
429
+ quantize:
430
+ runs-on: ubuntu-latest
431
+
432
+ steps:
433
+ - name: Clone
434
+ uses: actions/checkout@v3
435
+
436
+ - name: Test quantize
437
+ run: |
438
+ ./models/download-ggml-model.sh tiny.en
439
+ make quantize
440
+ ./quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
441
+
442
  # - name: Publish package
443
  # if: ${{ github.ref == 'refs/heads/master' }}
444
  # uses: gradle/gradle-build-action@v2
examples/quantize/quantize.cpp CHANGED
@@ -138,7 +138,7 @@ bool whisper_model_quantize(const std::string & fname_inp, const std::string & f
138
  // return false;
139
  //}
140
 
141
- char word[128];
142
 
143
  for (int i = 0; i < n_vocab; i++) {
144
  uint32_t len;
 
138
  // return false;
139
  //}
140
 
141
+ char word[129];
142
 
143
  for (int i = 0; i < n_vocab; i++) {
144
  uint32_t len;