Commit
·
295ca87
1
Parent(s):
6a71ed4
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
4 |
Usage:
|
5 |
|
6 |
```python
|
@@ -10,7 +14,7 @@ from peft import PeftModel
|
|
10 |
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
|
11 |
peft_model = PeftModel.from_pretrained(base_model,"reasonwang/flan-alpaca-lora-base")
|
12 |
|
13 |
-
inputs = tokenizer("
|
14 |
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
|
15 |
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
16 |
-
```
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
Out repository [flan-alpaca-lora](https://github.com/Reason-Wang/flan-alpaca-lora) contains the details to train flan-t5 with [Alpaca](https://github.com/tatsu-lab/stanford_alpaca) instructions and [low-rank adaptation](https://arxiv.org/abs/2106.09685).
|
5 |
+
|
6 |
+
You can use the following code easily.
|
7 |
+
|
8 |
Usage:
|
9 |
|
10 |
```python
|
|
|
14 |
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
|
15 |
peft_model = PeftModel.from_pretrained(base_model,"reasonwang/flan-alpaca-lora-base")
|
16 |
|
17 |
+
inputs = tokenizer("What should I say when my friend is crying?", return_tensors="pt")
|
18 |
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
|
19 |
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
20 |
+
```
|