Skip to content

Commit 4dab678

Browse files
dushyantbehlChanderG
authored andcommitted
Apply unescape on all fields
Signed-off-by: Dushyant Behl <dushyantbehl@in.ibm.com> Signed-off-by: ChanderG <mail@chandergovind.org>
1 parent 263264a commit 4dab678

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tuning/config/configs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ class DataArguments:
131131
},
132132
)
133133

134+
def __post_init__(self):
135+
def unescape(s):
136+
if s is not None and isinstance(s, str):
137+
return s.encode("utf-8").decode("unicode_escape")
138+
return s
139+
140+
self.chat_template = unescape(self.chat_template)
141+
self.data_formatter_template = unescape(self.data_formatter_template)
142+
self.response_template = unescape(self.response_template)
143+
self.instruction_template = unescape(self.instruction_template)
144+
134145

135146
@dataclass
136147
class TrainingArguments(transformers.TrainingArguments):

0 commit comments

Comments
 (0)