mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 02:58:50 +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 sum_logprob = 0f64;
|
||||||
let mut no_speech_prob = f64::NAN;
|
let mut no_speech_prob = f64::NAN;
|
||||||
let mut tokens = vec![self.sot_token];
|
let mut tokens = vec![self.sot_token];
|
||||||
|
if let Some(language_token) = self.language_token {
|
||||||
|
tokens.push(language_token);
|
||||||
|
}
|
||||||
match self.task {
|
match self.task {
|
||||||
Some(Task::Transcribe) => tokens.push(self.transcribe_token),
|
Some(Task::Transcribe) => tokens.push(self.transcribe_token),
|
||||||
Some(Task::Translate) => tokens.push(self.translate_token),
|
Some(Task::Translate) => tokens.push(self.translate_token),
|
||||||
@ -149,9 +152,6 @@ impl Decoder {
|
|||||||
// Nothing in this case, same as the Python implementation.
|
// Nothing in this case, same as the Python implementation.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(language_token) = self.language_token {
|
|
||||||
tokens.push(language_token);
|
|
||||||
}
|
|
||||||
if !self.timestamps {
|
if !self.timestamps {
|
||||||
tokens.push(self.no_timestamps_token);
|
tokens.push(self.no_timestamps_token);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user