Introduction of c4ai-command-r-v01-tokenizer-chat-template
Model Details of c4ai-command-r-v01-tokenizer-chat-template
Chat Template Tokenizer for c4ai-command-r-v01
This repository includes a fast tokenizer for
CohereForAI/c4ai-command-r-v01
with the Chat Template. The Tokenizer was created by replacing the string values of original tokens with id
255000
(
<|START_OF_TURN_TOKEN|>
) and
255001
(
<|END_OF_TURN_TOKEN|>
) with the role tokens
<|SYSTEM_TOKEN|>
,
<|USER_TOKEN|>
and
<|CHATBOT_TOKEN|>
.
No new tokens were added during that process to ensure that the original model's embedding doesn't need to be modified.
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("prince-canuma/c4ai-command-r-v01-tokenizer-chat-template")
messages = [
{"role": "user", "content": "Hello, how are you?"},
{"role": "assistant", "content": "I'm doing great. How can I help you today?"},
]
chatml = tokenizer.apply_chat_template(messages, add_generation_prompt=False, tokenize=False)
print(chatml)
# <|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN |># <|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Hello! I'm doing well, thank you for asking! I'm excited to assist you and I'm looking forward to hearing your questions. How can I help you today?<| END_OF_TURN_TOKE NI>
Test
tokenizer = AutoTokenizer.from_pretrained("prince-canuma/c4ai-command-r-v01-tokenizer-chat-template")
original_tokenizer = AutoTokenizer.from_pretrained("CohereForAI/c4ai-command-r-v01")
# get special tokensprint(tokenizer.special_tokens_map)
print(original_tokenizer.special_tokens_map)
# check length of vocabassertlen(tokenizer) == len(original_tokenizer), "tokenizer are not having the same length"
Runs of prince-canuma c4ai-command-r-v01-tokenizer-chat-template on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About c4ai-command-r-v01-tokenizer-chat-template huggingface.co Model
c4ai-command-r-v01-tokenizer-chat-template huggingface.co is an AI model on huggingface.co that provides c4ai-command-r-v01-tokenizer-chat-template's model effect (), which can be used instantly with this prince-canuma c4ai-command-r-v01-tokenizer-chat-template model. huggingface.co supports a free trial of the c4ai-command-r-v01-tokenizer-chat-template model, and also provides paid use of the c4ai-command-r-v01-tokenizer-chat-template. Support call c4ai-command-r-v01-tokenizer-chat-template model through api, including Node.js, Python, http.
c4ai-command-r-v01-tokenizer-chat-template huggingface.co is an online trial and call api platform, which integrates c4ai-command-r-v01-tokenizer-chat-template's modeling effects, including api services, and provides a free online trial of c4ai-command-r-v01-tokenizer-chat-template, you can try c4ai-command-r-v01-tokenizer-chat-template online for free by clicking the link below.
prince-canuma c4ai-command-r-v01-tokenizer-chat-template online free url in huggingface.co:
c4ai-command-r-v01-tokenizer-chat-template is an open source model from GitHub that offers a free installation service, and any user can find c4ai-command-r-v01-tokenizer-chat-template on GitHub to install. At the same time, huggingface.co provides the effect of c4ai-command-r-v01-tokenizer-chat-template install, users can directly use c4ai-command-r-v01-tokenizer-chat-template installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
c4ai-command-r-v01-tokenizer-chat-template install url in huggingface.co: