Download check_special.py from DevGwardo/minicpm5-toolcall-code: direct link, hf CLI and curl.
- Browser
- Download file 389 Bytes
-
https://huggingface.co/datasets/DevGwardo/minicpm5-toolcall-code/resolve/main/check_special.py
- Command line
-
hf download hf://datasets/DevGwardo/minicpm5-toolcall-code/check_special.py
-
curl -L -o check_special.py https://huggingface.co/datasets/DevGwardo/minicpm5-toolcall-code/resolve/main/check_special.py
389 Bytes
| from transformers import AutoTokenizer | |
| tok = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-1B") | |
| for t in ["<function", "</function>", "<param", "</param>", "<|im_end|>", "<tools>", "</tools>"]: | |
| print(repr(t), "id:", tok.convert_tokens_to_ids(t)) | |
| print("special tokens containing 'function' or 'param':") | |
| print([t for t in tok.all_special_tokens if "function" in t or "param" in t]) | |