Update README.md
Browse files
README.md
CHANGED
|
@@ -25,16 +25,14 @@ ALLaM-Thinking is an advanced Arabic Large Language Model specifically optimized
|
|
| 25 |
## Usage Example
|
| 26 |
|
| 27 |
```python
|
| 28 |
-
from transformers import AutoTokenizer
|
| 29 |
-
from vllm import SamplingParams
|
| 30 |
-
import torch
|
| 31 |
|
| 32 |
-
# Load the
|
| 33 |
tokenizer = AutoTokenizer.from_pretrained("almaghrabima/ALLaM-Thinking")
|
| 34 |
-
model = AutoModelForCausalLM.from_pretrained("almaghrabima/ALLaM-Thinking")
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
|
| 38 |
model = LLM(model="almaghrabima/ALLaM-Thinking")
|
| 39 |
|
| 40 |
# Format the prompt using chat template
|
|
@@ -50,25 +48,25 @@ sampling_params = SamplingParams(
|
|
| 50 |
)
|
| 51 |
|
| 52 |
# Generate response
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
sampling_params=sampling_params,
|
| 56 |
-
lora_request=None,
|
| 57 |
-
)[0].outputs[0].text
|
| 58 |
-
|
| 59 |
print(output)
|
| 60 |
```
|
| 61 |
|
| 62 |
-
##
|
| 63 |
|
| 64 |
```
|
| 65 |
-
ุฃููุงูุ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
| 72 |
```
|
| 73 |
|
| 74 |
## Unsloth Optimization
|
|
|
|
| 25 |
## Usage Example
|
| 26 |
|
| 27 |
```python
|
| 28 |
+
from transformers import AutoTokenizer
|
| 29 |
+
from vllm import LLM, SamplingParams
|
|
|
|
| 30 |
|
| 31 |
+
# Load the tokenizer
|
| 32 |
tokenizer = AutoTokenizer.from_pretrained("almaghrabima/ALLaM-Thinking")
|
|
|
|
| 33 |
|
| 34 |
+
# Initialize the model using vLLM
|
| 35 |
+
# Note: You should only initialize the model once, using vLLM directly
|
| 36 |
model = LLM(model="almaghrabima/ALLaM-Thinking")
|
| 37 |
|
| 38 |
# Format the prompt using chat template
|
|
|
|
| 48 |
)
|
| 49 |
|
| 50 |
# Generate response
|
| 51 |
+
outputs = model.generate([text], sampling_params)
|
| 52 |
+
output = outputs[0].outputs[0].text
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
print(output)
|
| 54 |
```
|
| 55 |
|
| 56 |
+
## Answer
|
| 57 |
|
| 58 |
```
|
| 59 |
+
ุฃููุงูุ ุฏุนูุง ูุฌุฏ ุนุฏุฏ ุงููุงุนุจูู ุงูุฐูู ูุณุฌููู ุงูุฃูุฏุงู.
|
| 60 |
+
|
| 61 |
+
40% ู
ู 15 ูุงุนุจุงู ูุณุงูู:
|
| 62 |
+
|
| 63 |
+
0.40 * 15 = 6 ูุงุนุจูู
|
| 64 |
|
| 65 |
+
ุงูุขูุ ุฅุฐุง ูุงู ูู ูุงุนุจ ู
ู ูุคูุงุก ุงููุงุนุจูู ุงูุณุชุฉ ูุณุฌู ูู ุงูู
ุชูุณุท 5 ุฃูุฏุงู ุฎูุงู ุงูู
ูุณู
ุ ูุฅู ุฅุฌู
ุงูู ุนุฏุฏ ุงูุฃูุฏุงู ุงูุชู ุณุฌููุง ุงููุงุนุจูู ุงูุฐูู ูุณุฌููู ุงูุฃูุฏุงู ุณูููู:
|
| 66 |
|
| 67 |
+
6 ูุงุนุจูู * 5 ุฃูุฏุงู ููู ูุงุนุจ = 30 ูุฏูุงู
|
| 68 |
|
| 69 |
+
ูุฐููุ ุณุฌู ุงููุงุนุจูู ุงูุฐูู ูุณุฌููู ุงูุฃูุฏุงู ู
ุฌู
ูุน 30 ูุฏูุงู ุฎูุงู ุงูู
ูุณู
.
|
| 70 |
```
|
| 71 |
|
| 72 |
## Unsloth Optimization
|