diff --git a/tools/transformers/modeling_internlm.py b/tools/transformers/modeling_internlm.py index fed7013..571971d 100644 --- a/tools/transformers/modeling_internlm.py +++ b/tools/transformers/modeling_internlm.py @@ -844,7 +844,7 @@ class InternLMForCausalLM(InternLMPreTrainedModel): self.query = query self.history = history self.response = "" - self.chche = [] + self.cache = [] self.received_inputs = False self.queue.put((self.response, history + [(self.query, self.response)])) @@ -859,8 +859,8 @@ class InternLMForCausalLM(InternLMPreTrainedModel): self.received_inputs = True return - self.chche.extend(value.tolist()) - token = self.tokenizer.decode(self.chche, skip_special_tokens=True) + self.cache.extend(value.tolist()) + token = self.tokenizer.decode(self.cache, skip_special_tokens=True) if "�" in token and len(token) <= 5: return @@ -868,7 +868,7 @@ class InternLMForCausalLM(InternLMPreTrainedModel): self.response = self.response + token history = self.history + [(self.query, self.response)] self.queue.put((self.response, history)) - self.chche = [] + self.cache = [] else: self.end()