Update modeling_internlm.py

Correct spelling mistakes: chche -> cache
pull/560/head
djsaber 2023-12-28 13:36:12 +08:00 committed by GitHub
parent 508711cc97
commit e7686e7fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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 "<EFBFBD>" 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()