Update README.md
Browse files
README.md
CHANGED
|
@@ -95,6 +95,25 @@ _ = model.generate(
|
|
| 95 |
streamer = TextStreamer(tokenizer, skip_prompt = True),
|
| 96 |
)
|
| 97 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
## Training Data
|
| 100 |
|
|
|
|
| 95 |
streamer = TextStreamer(tokenizer, skip_prompt = True),
|
| 96 |
)
|
| 97 |
```
|
| 98 |
+
**For pipeline:**
|
| 99 |
+
|
| 100 |
+
```python
|
| 101 |
+
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
| 102 |
+
from peft import PeftModel
|
| 103 |
+
|
| 104 |
+
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-0.6B")
|
| 105 |
+
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-0.6B")
|
| 106 |
+
model = PeftModel.from_pretrained(base_model, "khazarai/Quran-R1")
|
| 107 |
+
|
| 108 |
+
question = "How does the Quran address the issue of parental authority and children’s rights?"
|
| 109 |
+
|
| 110 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 111 |
+
messages = [
|
| 112 |
+
{"role": "user", "content": question}
|
| 113 |
+
]
|
| 114 |
+
pipe(messages)
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
|
| 118 |
## Training Data
|
| 119 |
|