Whisper tweaks (#85)

* Isolate the decoding bits of the whisper example.

* Decode -> Decoder.

* Add the suppress tokens filter.

* More suppress tokens.
This commit is contained in:
Laurent Mazare
2023-07-06 09:13:20 +01:00
committed by GitHub
parent be9b493a75
commit cd230d26fe
2 changed files with 72 additions and 39 deletions

View File

@ -15,7 +15,7 @@ impl<'a> VarBuilder<'a> {
pub fn from_safetensors(
safetensors: Vec<SafeTensors<'a>>,
dtype: DType,
device: Device,
device: &Device,
) -> Self {
let mut routing = HashMap::new();
for (index, sf) in safetensors.iter().enumerate() {
@ -25,7 +25,7 @@ impl<'a> VarBuilder<'a> {
}
Self {
safetensors: Some((routing, safetensors)),
device,
device: device.clone(),
dtype,
}
}