Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Cohere rerank-english-v2.0 tokenizer

This is the tokenizer for the Cohere Rerank Model.

You can load it with the transformers library like this:

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("Cohere/rerank-english-v2.0")
text = "Hello World, this is my input string!"
enc = tokenizer(text)
print("Encoded input:")
print(enc)

inv_vocab = {v: k for k, v in tokenizer.vocab.items()}
tokens = [inv_vocab[token_id] for token_id in enc['input_ids']]
print("Tokens:")
print(tokens)

number_of_tokens = len(enc['input_ids'])
print("Number of tokens:", number_of_tokens)
Downloads last month
0
Unable to determine this model's library. Check the docs .