File size: 2,931 Bytes
2065cb7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3662d90
 
 
 
2065cb7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3662d90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2065cb7
3662d90
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
library_name: transformers
license: mit
datasets:
- emhaihsan/quran-indonesia-tafseer-translation
language:
- id
base_model:
- Qwen/Qwen2.5-3B-Instruct
---

# Model Card for Fine-Tuned Qwen2.5-3B-Instruct

This is a fine-tuned version of the [Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) model. The fine-tuning process utilized the [Quran Indonesia Tafseer Translation](https://huggingface.co/datasets/emhaihsan/quran-indonesia-tafseer-translation) dataset, which provides translations and tafsir in Bahasa Indonesia for the Quran.

## Model Details

### Model Description

- **Base Model:** [Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct)
- **Fine-Tuned By:** Ellbendl Satria
- **Dataset:** [emhaihsan/quran-indonesia-tafseer-translation](https://huggingface.co/datasets/emhaihsan/quran-indonesia-tafseer-translation)
- **Language:** Bahasa Indonesia
- **License:** MIT

This model is designed for NLP tasks involving Quranic text in Bahasa Indonesia, including understanding translations and tafsir.

## Uses

### Direct Use

This model can be used for applications requiring the understanding, summarization, or retrieval of Quranic translations and tafsir in Bahasa Indonesia.

### Downstream Use

It is suitable for fine-tuning on tasks such as:
- Quranic text summarization
- Question answering systems related to Islamic knowledge
- Educational tools for learning Quranic content in Indonesian

### Biases
- The model inherits any biases present in the dataset, which is specific to Islamic translations and tafsir in Bahasa Indonesia.

### Recommendations
- Users should ensure that applications using this model respect cultural and religious sensitivities.
- Results should be verified by domain experts for critical applications.

## How to Get Started with the Model

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("Ellbendls/Qwen-2.5-3b-Quran")
model = AutoModelForCausalLM.from_pretrained("Ellbendls/Qwen-2.5-3b-Quran")

# Move the model to GPU
model.to("cuda")

# Define the input message
messages = [
    {
        "role": "user", 
        "content": "Tafsirkan ayat ini اِهْدِنَا الصِّرَاطَ الْمُسْتَقِيْمَۙ"
    }
]

# Generate the prompt using the tokenizer
prompt = tokenizer.apply_chat_template(messages, tokenize=False, 
                                       add_generation_prompt=True)

# Tokenize the prompt and move inputs to GPU
inputs = tokenizer(prompt, return_tensors='pt', padding=True, 
                   truncation=True).to("cuda")

# Generate the output using the model
outputs = model.generate(**inputs, max_length=150, 
                         num_return_sequences=1)

# Decode the output
text = tokenizer.decode(outputs[0], skip_special_tokens=True)

# Print the result
print(text.split("assistant")[1])
```