Disallowed special token found: <|im_start|>

I’m working on a repo which is teaching me about LLM and because of that the files contains the special tokens for the model. How can I somehow comment out / allow for these tokens to be taken as a context

@krzysztop Unfortunately, you can’t restrict the model directly allow/disallow replying for special tokens. This is a guardrail implemented to avoid prompt injection and is by design.

1 Like

Maybe it’s worth to think about some escaping mechanism. For e.g. remove them from the context or do sth similar to html escaping - replacing with “save” words