Text Generation
Transformers
Safetensors
English
t5
text2text-generation
english
quran
islamic
religious-texts
question-answering
text-generation-inference
Instructions to use justdeen/QuranPlus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use justdeen/QuranPlus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="justdeen/QuranPlus")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("justdeen/QuranPlus") model = AutoModelForSeq2SeqLM.from_pretrained("justdeen/QuranPlus", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use justdeen/QuranPlus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "justdeen/QuranPlus" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "justdeen/QuranPlus", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/justdeen/QuranPlus
- SGLang
How to use justdeen/QuranPlus 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 "justdeen/QuranPlus" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "justdeen/QuranPlus", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "justdeen/QuranPlus" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "justdeen/QuranPlus", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use justdeen/QuranPlus with Docker Model Runner:
docker model run hf.co/justdeen/QuranPlus
Add pipeline_tag and proper model card for Inference API
Browse files
README.md
CHANGED
|
@@ -1,22 +1,75 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
Training was interrupted but the model achieved excellent performance:
|
| 5 |
-
- **ROUGE-1: 0.9989 (99.89%)**
|
| 6 |
-
- Model is fully functional for Q&A tasks
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
## Usage
|
| 14 |
-
|
| 15 |
-
```
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
```
|
| 18 |
|
| 19 |
-
##
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
tags:
|
| 5 |
+
- transformers
|
| 6 |
+
- text-generation
|
| 7 |
+
- arabic
|
| 8 |
+
- quran
|
| 9 |
+
- islamic
|
| 10 |
+
- safetensors
|
| 11 |
+
language:
|
| 12 |
+
- ar
|
| 13 |
+
library_name: transformers
|
| 14 |
+
---
|
| 15 |
|
| 16 |
+
# QuranPlus
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
QuranPlus is a language model trained for Islamic and Quranic text generation.
|
| 19 |
+
|
| 20 |
+
## Model Description
|
| 21 |
+
|
| 22 |
+
This model is designed to generate text related to Islamic teachings and Quranic content in Arabic.
|
| 23 |
|
| 24 |
## Usage
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 28 |
+
|
| 29 |
+
# Load model and tokenizer
|
| 30 |
+
tokenizer = AutoTokenizer.from_pretrained("justdeen/QuranPlus")
|
| 31 |
+
model = AutoModelForCausalLM.from_pretrained("justdeen/QuranPlus")
|
| 32 |
+
|
| 33 |
+
# Generate text
|
| 34 |
+
input_text = "ما هو الإسلام؟"
|
| 35 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
| 36 |
+
|
| 37 |
+
with torch.no_grad():
|
| 38 |
+
outputs = model.generate(**inputs, max_length=100, do_sample=True)
|
| 39 |
+
|
| 40 |
+
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 41 |
+
print(generated_text)
|
| 42 |
```
|
| 43 |
|
| 44 |
+
## Inference API
|
| 45 |
+
|
| 46 |
+
You can also use this model via the Hugging Face Inference API:
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
import requests
|
| 50 |
+
|
| 51 |
+
API_URL = "https://api-inference.huggingface.co/models/justdeen/QuranPlus"
|
| 52 |
+
headers = {"Authorization": f"Bearer {YOUR_HF_TOKEN}"}
|
| 53 |
+
|
| 54 |
+
def query(payload):
|
| 55 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 56 |
+
return response.json()
|
| 57 |
+
|
| 58 |
+
output = query({
|
| 59 |
+
"inputs": "ما هو الإسلام؟",
|
| 60 |
+
})
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Training Details
|
| 64 |
+
|
| 65 |
+
This model was trained on Islamic and Quranic texts to provide accurate and contextually appropriate responses about Islamic teachings.
|
| 66 |
+
|
| 67 |
+
## Limitations
|
| 68 |
+
|
| 69 |
+
- The model is specifically trained for Islamic content
|
| 70 |
+
- Responses should be verified by Islamic scholars for religious accuracy
|
| 71 |
+
- May not perform well on non-Islamic topics
|
| 72 |
+
|
| 73 |
+
## License
|
| 74 |
+
|
| 75 |
+
Apache 2.0
|