增加call_行为

This commit is contained in:
glide-the 2023-05-26 01:46:59 +08:00
parent c4ee36b8ac
commit 25e5ab1282
1 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,14 @@ class ChatGLM(BaseAnswer, LLM, ABC):
self.history_len = history_len self.history_len = history_len
def _call(self, prompt: str, stop: Optional[List[str]] = None) -> str: def _call(self, prompt: str, stop: Optional[List[str]] = None) -> str:
pass response, _ = self.checkPoint.model.chat(
self.checkPoint.tokenizer,
prompt,
history=[],
max_length=self.max_token,
temperature=self.temperature
)
return response
def generatorAnswer(self, prompt: str, def generatorAnswer(self, prompt: str,
history: List[List[str]] = [], history: List[List[str]] = [],