[Docs] Add language identifiers to fenced code blocks (#28955)

Add language identifiers to code blocks
This commit is contained in:
Klaus Hipp
2024-02-12 19:48:31 +01:00
committed by GitHub
parent c617f988f8
commit fe3df9d5b3
66 changed files with 137 additions and 137 deletions

View File

@@ -390,7 +390,7 @@ If your model expects those, they won't be added automatically by `apply_chat_te
text will be tokenized with `add_special_tokens=False`. This is to avoid potential conflicts between the template and
the `add_special_tokens` logic. If your model expects special tokens, make sure to add them to the template!
```
```python
tokenizer.chat_template = "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
```