Views
No views yet
| 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 |
BIG_Persian_TEXT_QA_Conversations_DATASET1pip install torch transformers sentencepiece
2modeling_yasin.py and configuration_yasin.py files in your directory or use trust_remote_code=True.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "ysn-rfd/YASIN-Persian-Base"
5
6# Load Tokenizer & Model
7tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 torch_dtype=torch.float16,
11 device_map="auto",
12 trust_remote_code=True
13)
14
15# Instruction Prompt Format
16prompt = "توضیح بده هوش مصنوعی چگونه کار میکند؟"
17input_text = f"### سوال: {prompt}\n### پاسخ:"
18
19# Tokenize and Generate
20inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
21output = model.generate(
22 **inputs,
23 max_new_tokens=256,
24 temperature=0.7,
25 top_p=0.9,
26 do_sample=True
27)
28
29print(tokenizer.decode(output[0], skip_special_tokens=True))
30