Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
unsloth
conversational
Instructions to use hozifa1/Faqih-R1-14B-Islamic-AI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hozifa1/Faqih-R1-14B-Islamic-AI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hozifa1/Faqih-R1-14B-Islamic-AI") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hozifa1/Faqih-R1-14B-Islamic-AI") model = AutoModelForCausalLM.from_pretrained("hozifa1/Faqih-R1-14B-Islamic-AI", 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 hozifa1/Faqih-R1-14B-Islamic-AI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hozifa1/Faqih-R1-14B-Islamic-AI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hozifa1/Faqih-R1-14B-Islamic-AI", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hozifa1/Faqih-R1-14B-Islamic-AI
- SGLang
How to use hozifa1/Faqih-R1-14B-Islamic-AI 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 "hozifa1/Faqih-R1-14B-Islamic-AI" \ --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": "hozifa1/Faqih-R1-14B-Islamic-AI", "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 "hozifa1/Faqih-R1-14B-Islamic-AI" \ --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": "hozifa1/Faqih-R1-14B-Islamic-AI", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use hozifa1/Faqih-R1-14B-Islamic-AI 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 hozifa1/Faqih-R1-14B-Islamic-AI 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 hozifa1/Faqih-R1-14B-Islamic-AI to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for hozifa1/Faqih-R1-14B-Islamic-AI to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="hozifa1/Faqih-R1-14B-Islamic-AI", max_seq_length=2048, ) - Docker Model Runner
How to use hozifa1/Faqih-R1-14B-Islamic-AI with Docker Model Runner:
docker model run hf.co/hozifa1/Faqih-R1-14B-Islamic-AI
Unsloth Model Card
Browse files
README.md
CHANGED
|
@@ -1,73 +1,21 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
-
- ar
|
| 4 |
- en
|
| 5 |
-
license: apache-2.0
|
| 6 |
-
tags:
|
| 7 |
-
- experimental
|
| 8 |
-
- research-only
|
| 9 |
-
- islamic-studies
|
| 10 |
-
- comparative-fiqh
|
| 11 |
-
- deepseek-r1
|
| 12 |
-
- qwen2.5
|
| 13 |
-
- work-in-progress
|
| 14 |
-
pipeline_tag: text-generation
|
| 15 |
-
base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
|
| 16 |
-
---
|
| 17 |
-
|
| 18 |
-
# ⚠️ Faqih-R1-14B (Experimental Alpha Research Preview)
|
| 19 |
-
### نموذج الفقيه الذكي (نسخة بحثية تجريبية قيد التطوير والتقييم)
|
| 20 |
-
|
| 21 |
-
> [!CAUTION]
|
| 22 |
-
> ### 🛑 تنبيه ديني وأكاديمي صارم / STRICT DISCLAIMER:
|
| 23 |
-
> **هذا النموذج هو مشروع بحثي تجريبي (Alpha / Work in Progress) في مراحله الأولية، وهو غير جاهز أو معتمد إطلاقاً للفتوى أو الاستخدام الديني أو التوجيه الشرعي العملي.**
|
| 24 |
-
>
|
| 25 |
-
> * **الهدف من المشروع:** دراسة وتجربة تقنيات الاستدلال الآلي (Chain-of-Thought) والبحث الدلالي (RAG) في نصوص التراث والفقه المقارن لأغراض أكاديمية وبحثية بحتة.
|
| 26 |
-
> * **الرجوع للمصادر المعتمدة:** لا يجوز الاعتماد على مخرجات هذا النموذج في أخذ الأحكام الشرعية أو قضايا الحلال والحرام، ويجب الرجوع حصراً للمؤسسات الإفتائية الرسمية والعلماء الثقات المتخصصين.
|
| 27 |
-
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
## 📌 نبذة عن المشروع البحثي (About the Research)
|
| 31 |
-
مشروع **الفقيه (Faqih-R1)** يهدف إلى استكشاف كيفية تدريب النماذج اللغوية على:
|
| 32 |
-
1. فهم المصطلحات الفقهية والأصولية.
|
| 33 |
-
2. تتبع وتفكيك الخلاف الفقهي بين المذاهب الأربعة (الحنفية والمالكية والشافعية والحنابلة).
|
| 34 |
-
3. فحص آليات التفكير والاستدلال الشرعي (`<think>`) ومقارنتها بالاستدلال الفقهي البشري.
|
| 35 |
-
|
| 36 |
-
النموذج مبني كنسخة تجريبية أولية على معمارية `DeepSeek-R1-Distill-Qwen-14B` وما زال يخضع للتقييم والتحسين المستمر.
|
| 37 |
-
|
| 38 |
---
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
|
| 42 |
-
```python
|
| 43 |
-
import torch
|
| 44 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 45 |
-
|
| 46 |
-
MODEL_ID = "hozifa1/Faqih-R1-14B-Islamic-AI"
|
| 47 |
-
|
| 48 |
-
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 49 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 50 |
-
MODEL_ID,
|
| 51 |
-
torch_dtype=torch.bfloat16,
|
| 52 |
-
device_map="auto"
|
| 53 |
-
)
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
|
| 59 |
-
with
|
| 60 |
-
outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.6)
|
| 61 |
-
```
|
| 62 |
-
|
| 63 |
-
---
|
| 64 |
-
|
| 65 |
-
## 📦 النسخ التجريبية المكممة (GGUF Alpha)
|
| 66 |
-
للأغراض التجريبية على الأجهزة الشخصية:
|
| 67 |
-
👉 **[`hozifa1/Faqih-R1-14B-GGUF`](https://huggingface.co/hozifa1/Faqih-R1-14B-GGUF)**
|
| 68 |
-
|
| 69 |
-
---
|
| 70 |
|
| 71 |
-
|
| 72 |
-
* **عرضة للهلاوس والأخطاء:** قد يقع النموذج في الخلط بين أقوال الفقهاء أو صياغة عبارات غير دقيقة.
|
| 73 |
-
* **غير مؤهل للقضايا القضائية والأسرية:** مسائل الطلاق، المواريث، المعاملات المالية، والجنايات تتطلب فقهاء معتمدين ولا تخضع لمعالجة الذكاء الاصطناعي.
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/DeepSeek-R1-Distill-Qwen-14B-bnb-4bit
|
| 3 |
+
tags:
|
| 4 |
+
- text-generation-inference
|
| 5 |
+
- transformers
|
| 6 |
+
- unsloth
|
| 7 |
+
- qwen2
|
| 8 |
+
license: apache-2.0
|
| 9 |
language:
|
|
|
|
| 10 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Uploaded finetuned model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
- **Developed by:** hozifa1
|
| 16 |
+
- **License:** apache-2.0
|
| 17 |
+
- **Finetuned from model :** unsloth/DeepSeek-R1-Distill-Qwen-14B-bnb-4bit
|
| 18 |
|
| 19 |
+
This qwen2 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)
|
|
|
|
|
|