omkarthawakar
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -42,21 +42,31 @@ The current `transformers` version can be verified with: `pip list | grep transf
|
|
42 |
To load a specific checkpoint, simply pass a revision with a value between `"ckpt_000"` and `"ckpt_358"`. If no revision is provided, it will load `"ckpt_359"`, which is the final checkpoint.
|
43 |
|
44 |
```python
|
45 |
-
import torch
|
46 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
47 |
|
48 |
-
torch.set_default_device("cuda")
|
49 |
-
|
50 |
model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-05B", torch_dtype="auto", trust_remote_code=True)
|
51 |
tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
52 |
|
53 |
-
text = "
|
54 |
input_ids = tokenizer(text, return_tensors="pt").to('cuda').input_ids
|
55 |
outputs = model.generate(input_ids, max_length=1000, repetition_penalty=1.2, pad_token_id=tokenizer.eos_token_id)
|
56 |
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
|
57 |
|
58 |
```
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
## Intended Uses
|
61 |
|
62 |
Given the nature of the training data, the MobiLlama-05B model is best suited for prompts using the QA format, the chat format, and the code format.
|
|
|
42 |
To load a specific checkpoint, simply pass a revision with a value between `"ckpt_000"` and `"ckpt_358"`. If no revision is provided, it will load `"ckpt_359"`, which is the final checkpoint.
|
43 |
|
44 |
```python
|
|
|
45 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
46 |
|
|
|
|
|
47 |
model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-05B", torch_dtype="auto", trust_remote_code=True)
|
48 |
tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
49 |
|
50 |
+
text = "I was dancing in the river when "
|
51 |
input_ids = tokenizer(text, return_tensors="pt").to('cuda').input_ids
|
52 |
outputs = model.generate(input_ids, max_length=1000, repetition_penalty=1.2, pad_token_id=tokenizer.eos_token_id)
|
53 |
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
|
54 |
|
55 |
```
|
56 |
|
57 |
+
## Evaluation
|
58 |
+
| Evaluation Benchmark | MobiLlama-0.5B | MobiLlama-0.8B | MobiLlama-1.2B |
|
59 |
+
| ----------- | ----------- | ----------- |
|
60 |
+
| HellaSwag | 0.5252 | 0.5409 | 0.6299 |
|
61 |
+
| MMLU | 0.2645 | 0.2692 | 0.2423 |
|
62 |
+
| Arc Challenge | 0.2952 | 0.3020 | 0.3455 |
|
63 |
+
| TruthfulQA | 0.3805 | 0.3848 | 0.3557 |
|
64 |
+
| CrowsPairs | 0.6403 | 0.6482 | 0.6812 |
|
65 |
+
| PIQA | 0.7203 | 0.7317 | 0.7529 |
|
66 |
+
| Race | 0.3368 | 0.3337 | 0.3531 |
|
67 |
+
| SIQA | 0.4022 | 0.4160 | 0.4196 |
|
68 |
+
| Winogrande | 0.5753 | 0.5745 | 0.6108 |
|
69 |
+
|
70 |
## Intended Uses
|
71 |
|
72 |
Given the nature of the training data, the MobiLlama-05B model is best suited for prompts using the QA format, the chat format, and the code format.
|