Teja-Gollapudi
commited on
Commit
·
98192c2
1
Parent(s):
5641b43
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- tatsu-lab/alpaca
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
pipeline_tag: text2text-generation
|
7 |
+
library_name: transformers
|
8 |
+
license: other
|
9 |
+
---
|
10 |
+
|
11 |
+
|
12 |
+
# Model Details
|
13 |
+
|
14 |
+
- **Model name:** Flan-UL2-Alpaca-LORA
|
15 |
+
- **Model type:** - Text2Text Generation
|
16 |
+
- **Parent Model:** [google/flan-t5-xl](https://huggingface.co/google/flan-t5-xl)
|
17 |
+
- **Training dataset:** [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca)
|
18 |
+
- **Language:** English
|
19 |
+
- **Framework:** PyTorch
|
20 |
+
- **Model version:** 1.0
|
21 |
+
|
22 |
+
|
23 |
+
We take the instruction-tuned Flan models (trained on Academic datasets) and perform style transfer using the Alpaca dataset.
|
24 |
+
|
25 |
+
|
26 |
+
# License
|
27 |
+
- Parent model ([google/flan-t5-xl](https://huggingface.co/google/flan-t5-xl)): Apache 2.0
|
28 |
+
- Dataset ([Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca)) : cc-by-4.0
|
29 |
+
- Text-Davinci-3 (Used to generate Alpaca): [OpenAI License](https://openai.com/policies/terms-of-use)
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
# How to Use
|
34 |
+
|
35 |
+
```
|
36 |
+
import torch
|
37 |
+
from transformers import pipeline
|
38 |
+
|
39 |
+
# Chose the model inference precision
|
40 |
+
dtype = torch.float16 # options are torch.float16, torch.bfloat16, torch.float32
|
41 |
+
|
42 |
+
model = pipeline(model="VMware/flan-t5-xl-alpaca",device_map = 'auto',torch_dtype=dtype )
|
43 |
+
|
44 |
+
prompt = "YOUR PROMPT HERE"
|
45 |
+
|
46 |
+
output = model(prompt, max_length=512, do_sample=True)
|
47 |
+
|
48 |
+
|
49 |
+
```
|
50 |
+
|
51 |
+
|
52 |
+
Using Alpaca prompt template might generate better outputs for certain prompts as the model was trained using the bellow template.
|
53 |
+
|
54 |
+
```
|
55 |
+
# Chose the model inference precision
|
56 |
+
import torch
|
57 |
+
from transformers import pipeline
|
58 |
+
|
59 |
+
dtype = torch.float16 # options are torch.bfloat16, torch.float32
|
60 |
+
model = pipeline(model="VMware/flan-t5-xl-alpaca",device_map = 'auto',torch_dtype=dtype )
|
61 |
+
|
62 |
+
prompt_template = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:"
|
63 |
+
|
64 |
+
prompt = "YOUR PROMPT HERE"
|
65 |
+
|
66 |
+
output = model(prompt_template.format(instruction= prompt), max_length=512, do_sample=True)
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
```
|
71 |
+
|
72 |
+
# Training Details
|
73 |
+
|
74 |
+
The model was trained on 3xV100 GPUs using Accelerate and Deepspeed
|
75 |
+
|
76 |
+
* Hyperparameters:
|
77 |
+
* learning_rate = 3e-4
|
78 |
+
* batch_size = 128
|
79 |
+
* epochs = 3
|
80 |
+
|
81 |
+
|
82 |
+
```
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
# Limitations and Bias
|
87 |
+
|
88 |
+
The model is based on a large and diverse dataset, but it may still have limitations and biases in certain areas. Some limitations include:
|
89 |
+
|
90 |
+
- Language: The model is designed to work with English text only and may not perform as well in other languages.
|
91 |
+
|
92 |
+
|
93 |
+
In addition, the model may have some bias in terms of the data it was trained on. The dataset includes questions from a variety of sources, but it may not be representative of all populations or perspectives. As a result, the model may perform better or worse for certain types of questions or on certain types of texts.
|
94 |
+
|
95 |
+
# Contribution
|