release v0.1.3

Former-commit-id: 62c68bcbf591516e8f90b47810bea6f710fd23f6
This commit is contained in:
hiyouga
2023-07-21 16:48:34 +08:00
parent a1468139a5
commit dad7ca6633
4 changed files with 11 additions and 8 deletions

View File

@@ -84,6 +84,12 @@ class WebChatModel(ChatModel):
query, history, prefix, max_new_tokens=max_new_tokens, top_p=top_p, temperature=temperature
):
response += new_text
response = self.postprocess(response)
new_history = history + [(query, response)]
chatbot[-1] = [query, response]
yield chatbot, new_history
def postprocess(self, response: str) -> str:
response = response.replace("<", "&lt;")
response = response.replace(">", "&gt;")
return response