Downloads · 30 days
0
amirakhlaghiqqq/persian-llama2
persian-llama2 is a machine learning model from amirakhlaghiqqq. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
This tokenizer is an improved version of the LLaMA 2 tokenizer, specifically enhanced to provide better support for the Persian language. It combines the original LLaMA 2 tokenizer with a custom tokenizer trained on t…
Downloads · 30 days
0
Access
Public
Updated Nov 2, 2024
Repo size
500 KB
Likes
3
Public
Click a slice to open those files.
.json2.1 MB · 81%
From the Hugging Face model README
This tokenizer is an improved version of the LLaMA 2 tokenizer, specifically enhanced to provide better support for the Persian language. It combines the original LLaMA 2 tokenizer with a custom tokenizer trained on the Persian Wikipedia corpus, resulting in improved tokenization for Persian text while maintaining support for other languages.
The tokenizer was created using the following steps:
Persian Wikipedia Tokenizer Training:
Merging with LLaMA 2 Tokenizer:
To use this tokenizer with the Hugging Face Transformers library:
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("amirakhlaghiqqq/llama2-persian-tokenizer")
# Example usage
text = "این یک مثال به زبان فارسی است."
tokens = tokenizer(text)
print(tokens)