Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
# Model summary
|
4 |
+
|
5 |
+
Train flan-T5-large on alpaca dataset with LoRA
|
6 |
+
|
7 |
+
# training
|
8 |
+
|
9 |
+
* torch==2.0.0+cu117
|
10 |
+
* transformers==4.28.0.dev0
|
11 |
+
* 8 x V100 32G
|
12 |
+
|
13 |
+
# How to use
|
14 |
+
|
15 |
+
```python
|
16 |
+
import transformers
|
17 |
+
from peft import PeftModel
|
18 |
+
|
19 |
+
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-large")
|
20 |
+
peft_model = PeftModel.from_pretrained("zirui3/flan-t5-large-alpaca")
|
21 |
+
|
22 |
+
inputs = tokenizer("Any instruction that you like.", return_tensors="pt")
|
23 |
+
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
|
24 |
+
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
25 |
+
```
|