Downloads · 30 days
25
16% of all-time downloads
ysn-rfd/YASIN-Persian-Base
YASIN-Persian-Base is a text generation model from ysn-rfd. Use it when you need the model to write or continue text.
Downloads · 30 days
25
16% of all-time downloads
All-time downloads
157
Public
Parameters
228M
913 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors1.8 GB · 99%
From the Hugging Face model README
YASIN-Persian-Base is a state-of-the-art, large language model (LLM) specifically architected and trained from scratch for the Persian language. Unlike models that are simply fine-tuned versions of English models, YASIN has been developed with a deep focus on the morphological and syntactical nuances of Persian (Farsi) from day one.
YASIN utilizes a modern Transformer architecture optimized for stability and inference efficiency. Its design is inspired by high-performance models like Llama but customized for the Persian script.
| Parameter | Value | Description |
|---|---|---|
| Layers | 16 | Number of Transformer blocks |
| Hidden Size | 768 | Model representation dimension |
| Attention Heads | 16 | Number of multi-head attention units |
| Intermediate Size | 3072 | MLP expansion layer size |
| Context Length | 512 - 2048 | Supported sequence length (Tokens) |
| Vocab Size | 50257 | Optimized for Persian efficiency |
YASIN was trained on a massive, high-quality corpus specifically curated for Persian instruction-following and conversation.
BIG_Persian_TEXT_QA_Conversations_DATASETpip install torch transformers sentencepiece
Since YASIN uses a custom architecture, ensure you have the modeling_yasin.py and configuration_yasin.py files in your directory or use trust_remote_code=True.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "ysn-rfd/YASIN-Persian-Base"
# Load Tokenizer & Model
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# Instruction Prompt Format
prompt = "توضیح بده هوش مصنوعی چگونه کار میکند؟"
input_text = f"### سوال: {prompt}\n### پاسخ:"
# Tokenize and Generate
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
output = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
do_sample=True
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
If you use this model in your research or commercial applications, please cite the repository:
Developer: Yasin َAryanfard (ysn-rfd) Project: YASIN Large Language Model Project Contact: Hugging Face Profile
Document Version: 1.2.1 | Last Updated: 12/24/2025