ggerganov commited on
Commit
8831554
·
unverified ·
1 Parent(s): 803e1be

coreml : support quantized model files

Browse files
Files changed (1) hide show
  1. whisper.cpp +9 -0
whisper.cpp CHANGED
@@ -2598,6 +2598,15 @@ static std::string whisper_get_coreml_path_encoder(std::string path_bin) {
2598
  path_bin = path_bin.substr(0, pos);
2599
  }
2600
 
 
 
 
 
 
 
 
 
 
2601
  path_bin += "-encoder.mlmodelc";
2602
 
2603
  return path_bin;
 
2598
  path_bin = path_bin.substr(0, pos);
2599
  }
2600
 
2601
+ // match "-qx_x"
2602
+ pos = path_bin.rfind('-');
2603
+ if (pos != std::string::npos) {
2604
+ auto sub = path_bin.substr(pos);
2605
+ if (sub.size() == 5 && sub[1] == 'q' && sub[3] == '_') {
2606
+ path_bin = path_bin.substr(0, pos);
2607
+ }
2608
+ }
2609
+
2610
  path_bin += "-encoder.mlmodelc";
2611
 
2612
  return path_bin;