mirror of
https://github.com/huggingface/candle.git
synced 2025-06-14 09:57:10 +00:00
Add the mel filters for 128 bins. (#1295)
This commit is contained in:
@ -525,7 +525,11 @@ fn main() -> Result<()> {
|
||||
let config: Config = serde_json::from_str(&std::fs::read_to_string(config_filename)?)?;
|
||||
let tokenizer = Tokenizer::from_file(tokenizer_filename).map_err(E::msg)?;
|
||||
|
||||
let mel_bytes = include_bytes!("melfilters.bytes");
|
||||
let mel_bytes = match config.num_mel_bins {
|
||||
80 => include_bytes!("melfilters.bytes").as_slice(),
|
||||
128 => include_bytes!("melfilters128.bytes").as_slice(),
|
||||
nmel => anyhow::bail!("unexpected num_mel_bins {nmel}"),
|
||||
};
|
||||
let mut mel_filters = vec![0f32; mel_bytes.len() / 4];
|
||||
<byteorder::LittleEndian as byteorder::ByteOrder>::read_f32_into(mel_bytes, &mut mel_filters);
|
||||
|
||||
|
BIN
candle-examples/examples/whisper/melfilters128.bytes
Normal file
BIN
candle-examples/examples/whisper/melfilters128.bytes
Normal file
Binary file not shown.
Reference in New Issue
Block a user