BLACK0X80 commited on
Commit
ffa9277
·
verified ·
1 Parent(s): 0a8a5fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +166 -13
README.md CHANGED
@@ -1,21 +1,174 @@
1
  ---
2
- base_model: unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit
3
- tags:
4
- - text-generation-inference
5
- - transformers
6
- - unsloth
7
- - llama
8
- license: apache-2.0
9
  language:
 
10
  - en
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # Uploaded finetuned model
14
 
15
- - **Developed by:** BLACK0X80
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit
 
 
 
 
18
 
19
- This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
1
  ---
 
 
 
 
 
 
 
2
  language:
3
+ - ar
4
  - en
5
+ license: apache-2.0
6
+ base_model: meta-llama/Llama-3.1-8B
7
+ tags:
8
+ - llama
9
+ - arabic
10
+ - egyptian
11
+ - coding
12
+ - text-generation
13
+ - conversational
14
+ - unsloth
15
+ - trl
16
+ - fine-tuned
17
+ pipeline_tag: text-generation
18
+ library_name: transformers
19
+ ---
20
+
21
+ # Horus-Egy-Coder
22
+
23
+ **Egyptian Arabic coding assistant** — a fine-tuned Llama 3.1-8B model specialized in helping Arabic and Egyptian developers write, debug, and understand code.
24
+
25
+ > Built in Egypt 🇪🇬 | Powered by [Unsloth](https://github.com/unslothai/unsloth) + TRL
26
+
27
+ ---
28
+
29
+ ## Model Description
30
+
31
+ `horus-egy-coder` is a fine-tuned version of `meta-llama/Llama-3.1-8B-Instruct` trained to assist Arabic-speaking developers — with native understanding of Egyptian Arabic technical dialect. It can explain code in Arabic, help debug in conversational Egyptian, and write clean code with Arabic comments.
32
+
33
+ | Property | Value |
34
+ |---|---|
35
+ | **Base model** | meta-llama/Llama-3.1-8B-Instruct |
36
+ | **Parameters** | 1B (quantized BF16) |
37
+ | **Training** | Unsloth + HuggingFace TRL (2x faster) |
38
+ | **License** | Apache 2.0 |
39
+ | **Language** | Arabic 🇪🇬 / English |
40
+ | **Task** | Code generation, explanation, debugging |
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+ import torch
49
+
50
+ model_name = "BLACK0X80/horus-egy-coder"
51
+
52
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
53
+ model = AutoModelForCausalLM.from_pretrained(
54
+ model_name,
55
+ torch_dtype=torch.bfloat16,
56
+ device_map="auto"
57
+ )
58
+
59
+ messages = [
60
+ {
61
+ "role": "system",
62
+ "content": "أنت مساعد برمجة بيتكلم عربي مصري. بتشرح الكود بالعربي وبتساعد المطورين."
63
+ },
64
+ {
65
+ "role": "user",
66
+ "content": "اكتبلي function بـ Python بتحسب الـ factorial"
67
+ }
68
+ ]
69
+
70
+ input_ids = tokenizer.apply_chat_template(
71
+ messages,
72
+ tokenize=True,
73
+ add_generation_prompt=True,
74
+ return_tensors="pt"
75
+ ).to(model.device)
76
+
77
+ output = model.generate(
78
+ input_ids,
79
+ max_new_tokens=512,
80
+ temperature=0.7,
81
+ do_sample=True
82
+ )
83
+
84
+ print(tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True))
85
+ ```
86
+
87
  ---
88
 
89
+ ## Example Interactions
90
 
91
+ **Example 1 — Code explanation in Arabic:**
92
+ ```
93
+ User: فسرلي الكود ده
94
+ for i in range(len(arr)-1):
95
+ for j in range(len(arr)-i-1):
96
+ if arr[j] > arr[j+1]:
97
+ arr[j], arr[j+1] = arr[j+1], arr[j]
98
 
99
+ Model: ده Bubble Sort خوارزمية ترتيب بسيطة.
100
+ بتعمل loop على الـ array وبتقارن كل عنصر بالي بعده،
101
+ لو العنصر الأكبر جه الأول بتبدلهم...
102
+ ```
103
+
104
+ **Example 2 — Debugging:**
105
+ ```
106
+ User: الكود ده بيطلع IndexError، مش عارف ليه
107
+ Model: المشكلة في السطر ده... جرب كذا...
108
+ ```
109
+
110
+ ---
111
+
112
+ 🔢 GGUF Version (للأجهزة المحدودة)
113
+
114
+ لو جهازك مش عنده GPU كبير، استخدم النسخة المضغوطة:
115
+
116
+ [`BLACK0X80/horus-egy-coder-Q4_K_M-GGUF`](https://huggingface.co/BLACK0X80/horus-egy-coder-Q4_K_M-GGUF)
117
+
118
+ ```bash
119
+ # تشغيل بـ llama.cpp
120
+ ./llama-cli -m horus-egy-coder-Q4_K_M.gguf \
121
+ -p "أنت مساعد برمجة عربي مصري." \
122
+ --chat-format llama-3
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Training Details
128
+
129
+ - **Framework:** [Unsloth](https://github.com/unslothai/unsloth) (2x faster training, 60% less memory)
130
+ - **Library:** HuggingFace TRL (SFT Trainer)
131
+ - **Base:** `unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit`
132
+ - **Quantization:** BF16
133
+
134
+ ---
135
+
136
+ ## Intended Use
137
+
138
+ **Good for:**
139
+ - شرح الكود بالعربي المصري
140
+ - كتابة functions وscripts بـ Python
141
+ - Debugging مع تفسير الأخطاء بالعربي
142
+ - تعليم البرمجة للمبتدئين العرب
143
+
144
+ **Limitations:**
145
+ - النموذج fine-tuned على بيانات محدودة — ممكن يغلط في كود معقد جداً
146
+ - مش متخصص في لغات غير Python بنفس الكفاءة
147
+ - مش مناسب لـ production code بدون مراجعة بشرية
148
+
149
+ ---
150
+
151
+ ## About HORUS-AI
152
+
153
+ HORUS-AI is an Egyptian AI initiative focused on building Arabic and Egyptian-dialect AI models. Named after the ancient Egyptian god of knowledge, we aim to make AI accessible to Arabic-speaking developers.
154
+
155
+ - GitHub: [BLACK0X80](https://github.com/BLACK0X80)
156
+ - Web: [black0x80.vercel.app](https://black0x80.vercel.app)
157
+
158
+ ---
159
+
160
+ ## Citation
161
+
162
+ ```bibtex
163
+ @misc{horus-egy-coder-2025,
164
+ title={Horus-Egy-Coder: Egyptian Arabic Coding Assistant},
165
+ author={BLACK0X80 and HORUS-AI},
166
+ year={2025},
167
+ url={https://huggingface.co/BLACK0X80/horus-egy-coder},
168
+ note={Fine-tuned from meta-llama/Llama-3.1-8B-Instruct}
169
+ }
170
+ ```
171
+
172
+ ---
173
 
174
+ *Made with ❤️ in Egypt 🇪🇬*