This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python tokenizer_fix.py | |
import sentencepiece.sentencepiece_model_pb2 as model | |
m = model.ModelProto() | |
m.ParseFromString(open('./tokenizer.model', 'rb').read()) | |
m.pieces[92543].piece = '<|im_start|>' | |
m.pieces[92542].piece = '<|im_end|>' | |
m.pieces[92541].piece = '<|action_start|>' | |
m.pieces[92540].piece = '<|action_end|>' |