mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-22 23:42:06 +00:00
Correct input_length since habana extend input_length to max_input_length (#103)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
b45f648483
commit
d752317b5f
@ -97,6 +97,12 @@ impl Validation {
|
||||
// Unwrap is safe here
|
||||
let (inputs, input_length) = response_receiver.await.unwrap()?;
|
||||
|
||||
let input_length = if self.skip_tokenizer_in_tgi {
|
||||
inputs.chars().filter(|&c| c == ',').count() + 1
|
||||
} else {
|
||||
truncate.unwrap_or(self.max_input_length)
|
||||
};
|
||||
|
||||
// Get total tokens
|
||||
let max_new_tokens: u32 = if let Some(max_new_tokens) = max_new_tokens {
|
||||
max_new_tokens
|
||||
|
Loading…
Reference in New Issue
Block a user