Skip to content

Commit fa7d873

Browse files
fixup! feat: allow specifying the chat template as base64 to avoid weird escaping and templating issues
Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
1 parent cf9a897 commit fa7d873

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tuning/data/data_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# limitations under the License.
1414

1515
# Standard
16+
from base64 import b64decode
1617
from dataclasses import dataclass
1718
from typing import Dict, List, Optional
1819
import logging
1920
import os
20-
from base64 import b64decode
2121

2222
# Local
2323
from tuning.utils.utils import load_yaml_or_json
@@ -155,7 +155,9 @@ def _validate_dataprocessor_config(dataprocessor_config) -> DataPreProcessorConf
155155
c.chat_template = chat_template
156156
elif "chat_template_base64" in kwargs:
157157
chat_template_base64 = kwargs["chat_template_base64"]
158-
assert isinstance(chat_template_base64, str), "chat_template_base64 should be a string"
158+
assert isinstance(
159+
chat_template_base64, str
160+
), "chat_template_base64 should be a string"
159161
chat_template_bytes = b64decode(chat_template_base64)
160162
chat_template = chat_template_bytes.decode("utf-8")
161163
c.chat_template = chat_template

0 commit comments

Comments
 (0)