File size: 5,969 Bytes
f7de6b2
 
7eb850b
 
f7de6b2
 
1e955dd
5602f5f
1e955dd
d7d76f5
 
 
 
 
 
3ac4ec3
d7d76f5
 
 
 
 
 
 
 
 
1e955dd
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
 
 
3ac4ec3
7eb850b
 
 
f7de6b2
7eb850b
f7de6b2
7eb850b
 
 
f7de6b2
7eb850b
f7de6b2
7eb850b
 
 
f7de6b2
7eb850b
 
 
 
 
 
 
f7de6b2
7eb850b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f7de6b2
7eb850b
 
 
 
 
 
 
 
 
 
 
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
 
 
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
 
 
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
f7de6b2
7eb850b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
library_name: transformers
language:
- ar
---

<div style="text-align: right; direction: rtl;">
<img src="https://huggingface.co/malhajar/Shahin-v0.1/resolve/90e48b33b4b9f095665a9cc3e822283f2134568c/d125b8078db86fa7a2c3dc1d7cc3a125835680ec1d23fe94e6866083.jpg" alt="Shahin-v0.1" width="400"/>
  
# شاهين 0.1 

**شاهين 0.1** هو نموذج لغة ضخم (LLM) مصمم خصيصًا للهجة السورية، تكريمًا لصمود وروح الشعب السوري. هذا النموذج يمثل منارة للحرية والتقدم، وتم تطويره تكريمًا لانتصارهم بعد 70 عامًا من الدكتاتورية. يتميز بطلاقة فائقة في اللهجة السورية ويبرع في مجموعة واسعة من المهام، من إنشاء الحوارات إلى تقديم رؤى ثقافية وتحليل تاريخي والمزيد.

## تفاصيل النموذج

- **النموذج الأساسي**: بنية مخصصة مع 14 مليار معامل، محسنة للهجة السورية
- **اللغات المدعومة**: اللهجة السورية بشكل رئيسي، مع دعم أساسي للعربية الفصحى
- **بيانات التدريب**: مجموعة بيانات شاملة من اللهجة السورية، بما في ذلك اللغة المحكية، الأدب، الأرشيفات التاريخية، والمحتوى الذي أنشأه المستخدمون
- **الأجهزة والتدريب**: تدريب مكثف باستخدام 4 وحدات معالجة رسومات A100 لمدة 3 أيام مع مجموعات بيانات متخصصة

## الميزات الرئيسية

- **إتقان اللهجة السورية**: مصمم لالتقاط التفاصيل الدقيقة للهجة السورية، بما في ذلك الاختلافات الإقليمية والتعبيرات الاصطلاحية.
- **الحساسية الثقافية**: مدرب على بيانات تعكس التراث والعادات والتاريخ السوري لتقديم استجابات واعية ثقافيًا.
- **تطبيقات واسعة**: يبرع في الذكاء الاصطناعي للمحادثة، إنشاء المحتوى، التحليل التاريخي، والمهام التعليمية.
</div>

# Shahin-v0.1

**Shahin-v0.1** is a large language model (LLM) created specifically for the Syrian Arabic dialect, designed as a tribute to the resilience and spirit of the Syrian people. This model is a beacon of freedom and progress, developed in honor of their victory against 70 years of dictatorship. It offers unparalleled fluency in Syrian Arabic and excels in a wide range of tasks, from dialogue generation to cultural insights, history, and more.

## Model Details

- **Model Base**: Custom architecture with 14 billion parameters, optimized for Syrian Arabic
- **Languages Supported**: Primarily Syrian Arabic, with basic support for Modern Standard Arabic (MSA)
- **Training Data**: A comprehensive corpus of Syrian Arabic, including spoken language, literature, historical archives, and user-generated content
- **Hardware & Training**: Fine-tuned on 4 NVIDIA A100 GPUs over 3 days with specialized datasets

## Key Features

- **Syrian Dialect Mastery**: Designed to capture the nuances of Syrian Arabic, including regional variations and idiomatic expressions.
- **Cultural Sensitivity**: Trained on data reflecting Syrian heritage, customs, and history to generate culturally aware responses.
- **Wide Application**: Excels in conversational AI, content creation, historical analysis, and educational tasks.

## Example Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"

model_name = "malhajar/Shahin-v0.1"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "شو الأسباب يلي خلت الثورة السورية تستمر رغم كل الظروف؟"
messages = [
    {
        "role": "system",
        "content": "أنت مساعد افتراضي سوري، جاهز للإجابة على الأسئلة بكل وضوح وصدق."
    },
    {
        "role": "user",
        "content": prompt
    }
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    temperature=0.7,
    top_k=40,
    top_p=0.85,
    max_new_tokens=256,
    repetition_penalty=1.1,
)
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```

## Example Outputs

### Example 1

**Prompt:**

```
شو الأسباب يلي خلت الثورة السورية تستمر رغم كل الظروف؟
```

**Response:**

الثورة السورية استمرت بفضل إصرار الشعب السوري على الحرية والكرامة. الشعب ما تخلى عن مطالبه رغم القمع العنيف والظروف الصعبة، وكان في دعم كبير من المغتربين السوريين . الإرادة الحقيقية لتغيير الواقع المظلم كانت أقوى من أي تحدي.

### Example 2

**Prompt:**

```
احكيلي عن تاريخ قلعة حلب.
```

**Response:**

قلعة حلب هي واحدة من أهم المعالم التاريخية بسوريا، عمرها يرجع لأكثر من 4,000 سنة. كانت مركزاً للدفاع عن المدينة ومرت عليها حضارات عديدة مثل الحثيين، الرومان، والأيوبيين. اليوم، هي رمز للصمود السوري ومرآة لتاريخ الشعب العريق.

---

Shahin-v0.1 showcases the beauty and strength of Syrian Arabic and stands as a technological milestone for the Syrian people.

---