lucasmccabe-lmi
commited on
Commit
•
db19f08
1
Parent(s):
c644850
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-4.0
|
3 |
+
datasets:
|
4 |
+
- yahma/alpaca-cleaned
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
tags:
|
9 |
+
- alpaca
|
10 |
+
- peft
|
11 |
+
- gpt
|
12 |
+
- lora
|
13 |
+
- llm
|
14 |
+
---
|
15 |
+
# Model Card for Model ID
|
16 |
+
|
17 |
+
We provide a low-rank adapter for an instruction-tuned 6.7B-parameter GPT3-style language model.
|
18 |
+
|
19 |
+
Example instruction:
|
20 |
+
|
21 |
+
```
|
22 |
+
Write a list of things I need to do to plan a watch party for Game 4 of the Knicks-Cavs playoff series.
|
23 |
+
```
|
24 |
+
|
25 |
+
Corresponding response from the model:
|
26 |
+
|
27 |
+
```
|
28 |
+
1. Find out where the game will be played and purchase tickets.
|
29 |
+
2. Decide on food, drinks, decorations, and entertainment.
|
30 |
+
3. Plan the route to get there.
|
31 |
+
4. Arrange transportation.
|
32 |
+
5. Organize games and activities for guests.
|
33 |
+
6. Make sure everyone has their tickets.
|
34 |
+
7. Set up the venue.
|
35 |
+
8. Prepare for the event.
|
36 |
+
9. Clean up after the event.
|
37 |
+
10. Celebrate with friends and family.
|
38 |
+
```
|
39 |
+
|
40 |
+
## Quickstart
|
41 |
+
|
42 |
+
Setting up the model using `transformers` and `peft`:
|
43 |
+
|
44 |
+
```python
|
45 |
+
from peft import PeftModel
|
46 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
47 |
+
|
48 |
+
tokenizer = AutoTokenizer.from_pretrained("cerebras/Cerebras-GPT-6.7B")
|
49 |
+
tokenizer.pad_token_id = 0
|
50 |
+
|
51 |
+
model = AutoModelForCausalLM.from_pretrained(
|
52 |
+
"cerebras/Cerebras-GPT-6.7B",
|
53 |
+
load_in_8bit=True,
|
54 |
+
device_map="auto",
|
55 |
+
)
|
56 |
+
model = PeftModel.from_pretrained(
|
57 |
+
model,
|
58 |
+
"lucasmccabe-lmi/GPT-6.7B-CleanedAlpaca-1"
|
59 |
+
)
|
60 |
+
```
|
61 |
+
|
62 |
+
## Prompting
|
63 |
+
|
64 |
+
For instructions that **do not** require extraneous inputs, the recommended prompt is:
|
65 |
+
|
66 |
+
```
|
67 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
68 |
+
|
69 |
+
|
70 |
+
### Instruction:
|
71 |
+
|
72 |
+
< -- instruction goes here --- >
|
73 |
+
|
74 |
+
### Response:
|
75 |
+
```
|
76 |
+
|
77 |
+
For instructions that **do** require extraneous inputs, the recommended prompt is:
|
78 |
+
|
79 |
+
```
|
80 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
81 |
+
|
82 |
+
|
83 |
+
### Instruction:
|
84 |
+
|
85 |
+
< -- instruction goes here -- >
|
86 |
+
|
87 |
+
### Input:
|
88 |
+
|
89 |
+
< -- extraneous input goes here -- >
|
90 |
+
|
91 |
+
### Response:
|
92 |
+
```
|
93 |
+
|
94 |
+
Since the model performs [causal language modeling](https://huggingface.co/docs/transformers/tasks/language_modeling), the model's response to the prompt is the text completing the sequence beginning with the prompt.
|
95 |
+
|
96 |
+
|
97 |
+
## Instruction-Tuning
|
98 |
+
|
99 |
+
This model was instruction-tuned on [a cleaned version of the Stanford Alpaca dataset](https://github.com/gururise/AlpacaDataCleaned), consisting of 52k post-processed instruction-input-output triplets derived from OpenAI's `text-davinci-003`.
|
100 |
+
|
101 |
+
- **Epochs**: 3
|
102 |
+
- **Batch size**: 128
|
103 |
+
- **Cutoff length**: 512
|
104 |
+
- **Learning rate**: 2e-5
|
105 |
+
- **LoRA _r_**: 4
|
106 |
+
- **LoRA _alpha_**: 16
|
107 |
+
- **LoRA _dropout_**: 0.05
|
108 |
+
- **LoRA target modules**: `c_attn`
|
109 |
+
|
110 |
+
- **Dataset**: [yahma/alpaca-cleaned](https://huggingface.co/datasets/yahma/alpaca-cleaned)
|
111 |
+
- **License**: The instruction-tuning data is subject to the [Creative Commons 4.0](https://creativecommons.org/licenses/by/4.0/) license.
|
112 |
+
|
113 |
+
## Base Model
|
114 |
+
|
115 |
+
This model was instruction-tuned from a 6.7B variant from the Cerebras-GPT family. These models were pre-trained to the ["Chinchilla-optimal"](https://arxiv.org/abs/2203.15556) 20*6.7B tokens from [EleutherAI/The Pile](https://huggingface.co/datasets/EleutherAI/the_pile).
|
116 |
+
|
117 |
+
- **Repository:** [cerebras/Cerebras-GPT-6.7B](https://huggingface.co/cerebras/Cerebras-GPT-6.7B)
|
118 |
+
- **Paper:** [arxiv:2304.03208](https://arxiv.org/abs/2304.03208)
|
119 |
+
- **License**: The base model is subject to the Apache 2.0 license.
|
120 |
+
- **Model type**: Transformer-based Language Model
|
121 |
+
|
122 |
+
### Software
|
123 |
+
|
124 |
+
We used [LMI's](https://huggingface.co/lmiconsulting) internal `liger` library, which is built on `PyTorch` and the excellent Hugging Face stack (`transformers`, `accelerate`, etc.).
|
125 |
+
|
126 |
+
## Author
|
127 |
+
|
128 |
+
- [lucasmccabe-lmi](https://lucasmccabe.github.io/)
|