Commit
·
f303ddf
1
Parent(s):
2cc7a94
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,7 +4,7 @@ license: gpl-3.0
|
|
| 4 |
|
| 5 |
# Description
|
| 6 |
|
| 7 |
-
This model demonstrates that GPT-J can work perfectly well as an "instruct" model when properly fine-tuned.
|
| 8 |
|
| 9 |
We fine-tuned GPT-J on an instruction dataset created by the [Stanford Alpaca team](https://github.com/tatsu-lab/stanford_alpaca). You can find the original dataset [here](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json).
|
| 10 |
|
|
@@ -26,7 +26,7 @@ I do not wan to go
|
|
| 26 |
Correction:
|
| 27 |
```
|
| 28 |
|
| 29 |
-
Now, with Instruct GPT-J,
|
| 30 |
|
| 31 |
```text
|
| 32 |
Correct spelling and grammar from the following text.
|
|
@@ -39,9 +39,11 @@ Which returns the following:
|
|
| 39 |
I do not want to go.
|
| 40 |
```
|
| 41 |
|
|
|
|
|
|
|
| 42 |
## How To Use The Model?
|
| 43 |
|
| 44 |
-
Using the model in
|
| 45 |
|
| 46 |
```python
|
| 47 |
from transformers import pipeline
|
|
@@ -54,7 +56,7 @@ prompt = "Correct spelling and grammar from the following text.\nI do not wan to
|
|
| 54 |
print(generator(prompt))
|
| 55 |
```
|
| 56 |
|
| 57 |
-
You can also use the `generate()` function
|
| 58 |
|
| 59 |
```python
|
| 60 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
@@ -69,4 +71,11 @@ inputs = tokenizer(prompt, return_tensors='pt')
|
|
| 69 |
outputs = generator.generate(inputs.input_ids.cuda())
|
| 70 |
|
| 71 |
print(tokenizer.decode(outputs[0]))
|
| 72 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Description
|
| 6 |
|
| 7 |
+
This model demonstrates that GPT-J can work perfectly well as an "instruct" model when properly fine-tuned. It is an fp16 version that makes it easy to deploy the model an entry level GPU like an NVIDIA Tesla T4. Want to know more about NLP Cloud? [Have a look at our platform here](https://nlpcloud.com).
|
| 8 |
|
| 9 |
We fine-tuned GPT-J on an instruction dataset created by the [Stanford Alpaca team](https://github.com/tatsu-lab/stanford_alpaca). You can find the original dataset [here](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json).
|
| 10 |
|
|
|
|
| 26 |
Correction:
|
| 27 |
```
|
| 28 |
|
| 29 |
+
Now, with Instruct GPT-J, you can ask things in natural language "like a human":
|
| 30 |
|
| 31 |
```text
|
| 32 |
Correct spelling and grammar from the following text.
|
|
|
|
| 39 |
I do not want to go.
|
| 40 |
```
|
| 41 |
|
| 42 |
+
You can also perfectly keep using few-shot learning on this model for very advanced use cases.
|
| 43 |
+
|
| 44 |
## How To Use The Model?
|
| 45 |
|
| 46 |
+
Using the model in fp16 with the text generation pipeline, here is what you can do:
|
| 47 |
|
| 48 |
```python
|
| 49 |
from transformers import pipeline
|
|
|
|
| 56 |
print(generator(prompt))
|
| 57 |
```
|
| 58 |
|
| 59 |
+
You can also use the `generate()` function. Here is what you can do:
|
| 60 |
|
| 61 |
```python
|
| 62 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
|
| 71 |
outputs = generator.generate(inputs.input_ids.cuda())
|
| 72 |
|
| 73 |
print(tokenizer.decode(outputs[0]))
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## Hardware Requirements
|
| 77 |
+
|
| 78 |
+
This model is an fp16 version of our fine-tuned model, which works very well on a GPU with 16GB of VRAM like an NVIDIA Tesla T4.
|
| 79 |
+
|
| 80 |
+
We did not notice any difference between the fp32 and fp16 versions in terms of quality.
|
| 81 |
+
|