treat do_lower_case in the same way as the sentence-transformers library (#11815)

Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
This commit is contained in:
Maximilien de Bayser
2025-01-09 11:05:43 +08:00
committed by GitHub
parent 615e4a5401
commit 1fe554bac3
5 changed files with 13 additions and 5 deletions
+6
View File
@@ -190,6 +190,12 @@ class InputPreprocessor:
# on the task and language of their request. Also needed to avoid
# appending an EOS token to the prompt which disrupts generation.
add_special_tokens = False
if (self.model_config.encoder_config is not None
and self.model_config.encoder_config.get(
"do_lower_case", False)):
prompt = prompt.lower()
return tokenizer.encode(request_id=request_id,
prompt=prompt,
lora_request=lora_request,