adding llama3 fastchat conversation monkeypatch (#1539)
* adding llama3 fastchat conversation monkeypatch * Updated conversation turns to work with PR3259 of FastChat * fixed bos token * bump fastchat version --------- Co-authored-by: Wing Lian <wing.lian@gmail.com>
This commit is contained in:
committed by
GitHub
parent
fff06af8d0
commit
b32c08f8cc
@@ -28,7 +28,7 @@ scipy
|
|||||||
scikit-learn==1.2.2
|
scikit-learn==1.2.2
|
||||||
pynvml
|
pynvml
|
||||||
art
|
art
|
||||||
fschat @ git+https://github.com/lm-sys/FastChat.git@5095615810cf613dba7f27dd155f571fcff976d8
|
fschat @ git+https://github.com/lm-sys/FastChat.git@27a05b04a35510afb1d767ae7e5990cbd278f8fe
|
||||||
gradio==3.50.2
|
gradio==3.50.2
|
||||||
tensorboard
|
tensorboard
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,17 @@ def get_turns( # pylint: disable=too-many-return-statements
|
|||||||
else:
|
else:
|
||||||
yield role, ""
|
yield role, ""
|
||||||
return
|
return
|
||||||
|
if self.sep_style == SeparatorStyle.LLAMA3:
|
||||||
|
if self.system_message:
|
||||||
|
# For llama3, the system message is NOT incorporated into the first human instruction
|
||||||
|
# All messages follow <|start_header_id|>' + role + '<|end_header_id|>\n\n'+ message + '<|eot_id|>
|
||||||
|
yield "", system_prompt
|
||||||
|
for i, (role, message) in enumerate(self.messages):
|
||||||
|
if message:
|
||||||
|
yield f"<|start_header_id|>{role}<|end_header_id|>\n\n", f"{message.strip()}<|eot_id|>"
|
||||||
|
else:
|
||||||
|
yield f"<|start_header_id|>{role}<|end_header_id|>\n\n", ""
|
||||||
|
return
|
||||||
if self.sep_style == SeparatorStyle.GEMMA:
|
if self.sep_style == SeparatorStyle.GEMMA:
|
||||||
if self.system_message:
|
if self.system_message:
|
||||||
raise ValueError("Gemma chat template does not support system messages")
|
raise ValueError("Gemma chat template does not support system messages")
|
||||||
|
|||||||
Reference in New Issue
Block a user