nroggendorff
commited on
Commit
•
d4edafa
1
Parent(s):
1819d9b
Update README.md
Browse files
README.md
CHANGED
@@ -1,50 +1,71 @@
|
|
1 |
---
|
2 |
-
license:
|
3 |
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
4 |
tags:
|
5 |
- trl
|
6 |
- sft
|
7 |
-
-
|
8 |
model-index:
|
9 |
- name: mayo
|
10 |
results: []
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
-
|
14 |
-
should probably proofread and complete it, then remove this comment. -->
|
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 |
-
- eval_batch_size: 16
|
40 |
-
- seed: 42
|
41 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
42 |
-
- lr_scheduler_type: linear
|
43 |
-
- training_steps: 350
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
4 |
tags:
|
5 |
- trl
|
6 |
- sft
|
7 |
+
- sgd
|
8 |
model-index:
|
9 |
- name: mayo
|
10 |
results: []
|
11 |
+
datasets:
|
12 |
+
- nroggendorff/mayo
|
13 |
+
language:
|
14 |
+
- en
|
15 |
---
|
16 |
|
17 |
+
# Mayonnaise LLM
|
|
|
18 |
|
19 |
+
Mayo is a language model fine-tuned on the [Mayo dataset](https://huggingface.co/datasets/nroggendorff/mayo) using Supervised Fine-Tuning (SFT) and Teacher Reinforced Learning (TRL) techniques. It is based on the [TinyLlama/TinyLlama-1.1B-Chat-v1.0 model](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0).
|
20 |
|
21 |
+
## Features
|
22 |
|
23 |
+
- Utilizes SFT and TRL techniques for improved performance
|
24 |
+
- Supports English language
|
25 |
|
26 |
+
## Usage
|
27 |
|
28 |
+
To use the Mayo LLM, you can load the model using the Hugging Face Transformers library:
|
29 |
|
30 |
+
```python
|
31 |
+
from transformers import pipeline
|
32 |
|
33 |
+
pipe = pipeline("text-generation", model="nroggendorff/mayo")
|
34 |
|
35 |
+
question = "What color is the sky?"
|
36 |
+
conv = [{"role": "user", "content": question}]
|
37 |
|
38 |
+
response = pipe(conv, max_new_tokens=32)[0]['generated_text'][-1]['content']
|
39 |
+
print(response)
|
40 |
+
```
|
41 |
|
42 |
+
To use the model with quantization:
|
43 |
|
44 |
+
```python
|
45 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
46 |
+
import torch
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
bnb_config = BitsAndBytesConfig(
|
49 |
+
load_in_4bit=True,
|
50 |
+
bnb_4bit_use_double_quant=True,
|
51 |
+
bnb_4bit_quant_type="nf4",
|
52 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
53 |
+
)
|
54 |
|
55 |
+
model_id = "nroggendorff/mayo"
|
56 |
+
|
57 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
58 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_config)
|
59 |
+
|
60 |
+
prompt = "<|user|>\nWhat color is the sky?</s>\n"
|
61 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
62 |
+
|
63 |
+
outputs = model.generate(**inputs, max_new_tokens=32)
|
64 |
+
|
65 |
+
generated_text = tokenizer.batch_decode(outputs)[0]
|
66 |
+
print(generated_text)
|
67 |
+
```
|
68 |
+
|
69 |
+
## License
|
70 |
+
|
71 |
+
This project is licensed under the MIT License.
|