CoolFace
Modelpublic

nazimali/mistral-7b-v0.3-instruct-arabic

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes92downloads
Model Card

Experimenting with pre-training Arabic language + finetuning on instructions using the quantized model mistralai/Mistral-7B-v0.3 from unsloth. First time trying pre-training, expect issues and low quality outputs. The repo contains the merged, quantized model and a GGUF format.

See spaces demo example.

Example usage

llama-cpp-python
python
from llama_cpp import Llama

inference_prompt = """فيما يلي تعليمات تصف مهمة. اكتب استجابة تكمل الطلب بشكل مناسب.

### تعليمات:
{}

### إجابة:
"""

llm = Llama.from_pretrained(
	repo_id="nazimali/mistral-7b-v0.3-instruct-arabic",
	filename="Q4_K_M.gguf",
)

llm.create_chat_completion(
	messages = [
		{
			"role": "user",
			"content": inference_prompt.format("السلام عليكم كيف حالك؟")
		}
	]
)
llama.cpp
shell
./llama-cli \
  --hf-repo "nazimali/mistral-7b-v0.3-instruct-arabic" \
  --hf-file Q4_K_M.gguf \
  -p "السلام عليكم كيف حالك؟" \
  --conversation

Training

Pre-training data:
  • —wikimedia/wikipedia
  • —20231101.ar
  • —Used 6,096 rows, 0.05% of the total data
Finetuning data:
  • —FreedomIntelligence/alpaca-gpt4-arabic
  • —Used 49,969 rows, 100% of all the data
Finetuning instruction format:
python
finetune_prompt = """فيما يلي تعليمات تصف مهمة. اكتب استجابة تكمل الطلب بشكل مناسب.

### تعليمات:
{}

### إجابة:
"""