Text Generation
Transformers
Safetensors
Arabic
English
llama
arabic
egyptian
coding
conversational
unsloth
trl
fine-tuned
text-generation-inference
Instructions to use BLACK0X80/horus-egy-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BLACK0X80/horus-egy-coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BLACK0X80/horus-egy-coder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BLACK0X80/horus-egy-coder") model = AutoModelForCausalLM.from_pretrained("BLACK0X80/horus-egy-coder", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BLACK0X80/horus-egy-coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BLACK0X80/horus-egy-coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BLACK0X80/horus-egy-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BLACK0X80/horus-egy-coder
- SGLang
How to use BLACK0X80/horus-egy-coder with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "BLACK0X80/horus-egy-coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BLACK0X80/horus-egy-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "BLACK0X80/horus-egy-coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BLACK0X80/horus-egy-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use BLACK0X80/horus-egy-coder with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BLACK0X80/horus-egy-coder to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BLACK0X80/horus-egy-coder to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for BLACK0X80/horus-egy-coder to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="BLACK0X80/horus-egy-coder", max_seq_length=2048, ) - Docker Model Runner
How to use BLACK0X80/horus-egy-coder with Docker Model Runner:
docker model run hf.co/BLACK0X80/horus-egy-coder
Update README.md
Browse files
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
|
|
|
|
|
|
|
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|
|
| 20 |
|
| 21 |
-
|
|
|
|
| 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 🇪🇬*
|