mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 10:38:54 +00:00
Put the transcribe token before the language one. (#553)
This commit is contained in:
@ -142,6 +142,9 @@ impl Decoder {
|
||||
let mut sum_logprob = 0f64;
|
||||
let mut no_speech_prob = f64::NAN;
|
||||
let mut tokens = vec![self.sot_token];
|
||||
if let Some(language_token) = self.language_token {
|
||||
tokens.push(language_token);
|
||||
}
|
||||
match self.task {
|
||||
Some(Task::Transcribe) => tokens.push(self.transcribe_token),
|
||||
Some(Task::Translate) => tokens.push(self.translate_token),
|
||||
@ -149,9 +152,6 @@ impl Decoder {
|
||||
// Nothing in this case, same as the Python implementation.
|
||||
}
|
||||
}
|
||||
if let Some(language_token) = self.language_token {
|
||||
tokens.push(language_token);
|
||||
}
|
||||
if !self.timestamps {
|
||||
tokens.push(self.no_timestamps_token);
|
||||
}
|
||||
|
Reference in New Issue
Block a user