model server fix message model

This commit is contained in:
yhjun1026
2023-06-01 19:10:12 +08:00
parent 98a7bf93f6
commit ab40a68c8f
3 changed files with 7 additions and 33 deletions

View File

@@ -52,9 +52,10 @@ class BaseOutputParser(ABC):
""" TODO Multi mode output handler, rewrite this for multi model, use adapter mode.
"""
if data["error_code"] == 0:
if CFG.LLM_MODEL in ["vicuna-13b", "guanaco"]:
output = data["text"][skip_echo_len:].strip()
if "vicuna" in CFG.LLM_MODEL:
output = data["text"][skip_echo_len + 11:].strip()
elif "guanaco" in CFG.LLM_MODEL:
output = data["text"][skip_echo_len + 14:].replace("<s>", "").strip()
else:
output = data["text"].strip()