Unverified Commit 909f3436 authored by havetc's avatar havetc Committed by GitHub
Browse files

[FIX] Wrong logger (#1230)

parent 5ff25cdf
...@@ -269,12 +269,12 @@ class Req: ...@@ -269,12 +269,12 @@ class Req:
all_text = self.origin_input_text + self.decoded_text + jump_forward_str all_text = self.origin_input_text + self.decoded_text + jump_forward_str
all_ids = self.tokenizer.encode(all_text) all_ids = self.tokenizer.encode(all_text)
if not all_ids: if not all_ids:
warnings.warn("Encoded all_text resulted in empty all_ids") logger.warning("Encoded all_text resulted in empty all_ids")
return False return False
prompt_tokens = len(self.origin_input_ids_unpadded) prompt_tokens = len(self.origin_input_ids_unpadded)
if prompt_tokens > len(all_ids): if prompt_tokens > len(all_ids):
warnings.warn("prompt_tokens is larger than encoded all_ids") logger.warning("prompt_tokens is larger than encoded all_ids")
return False return False
if all_ids[prompt_tokens - 1] != self.origin_input_ids_unpadded[-1]: if all_ids[prompt_tokens - 1] != self.origin_input_ids_unpadded[-1]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment