Downloads · 30 days
0
Aananda-giri/NepaliBPE
NepaliBPE is a machine learning model from Aananda-giri. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
- This repository contains a Byte Pair Encoding (BPE) tokenizer trained using the Hugging Face transformers package on ~30GB of Nepali LLM dataset (IRIISNEPAL/Nepali-Text-Corpus + nepberta-dataset). - The tokenizer ha…
Downloads · 30 days
0
Access
Public
Updated Jan 14, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.json5 MB · 100%
From the Hugging Face model README
transformers package on ~30GB of Nepali LLM dataset (IRIISNEPAL/Nepali-Text-Corpus + nepberta-dataset).<id> <token>
0: <|endoftext|>
1: <|unk|>
50000: <|begin_of_text|>
50001: <|end_of_text|>
50002: <|start_header_id|>
50003: <|end_header_id|>
50004: <|eot_id|>
50005: '\n\n'
To use the tokenizer, you need to install the transformers library. You can install it via pip:
pip install transformers
You can easily load the tokenizer using the following code:
from transformers import PreTrainedTokenizerFast
# Load the tokenizer
tokenizer = PreTrainedTokenizerFast.from_pretrained("Aananda-giri/NepaliBPE")
# Example usage
tokenizer.tokenize('राम ले भात खायो ।')
# ['राम</w>', 'ले</w>', 'भात</w>', 'खायो</w>', '।</w>']
tokenizer.encode('राम ले भात खायो ।')
# [1621, 285, 14413, 27675, 251]
tokenizer.decode([1621, 285, 14413, 27675, 251])
# राम ले भात खायो ।