File size: 1,887 Bytes
c0264ec
 
dbf27d0
 
 
 
c0264ec
 
 
dbf27d0
 
 
 
3915d16
dbf27d0
 
c0264ec
dbf27d0
c0264ec
dbf27d0
 
 
 
c0264ec
dbf27d0
c0264ec
dbf27d0
 
 
 
 
480a198
dbf27d0
 
c0264ec
dbf27d0
c0264ec
dbf27d0
 
 
c0264ec
dbf27d0
c0264ec
 
 
dbf27d0
c0264ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
tags:
- gpt-neo
- gpt-peter
- chatbot

---


# pszemraj/gpt-peter-2.7B

- This model is a fine-tuned version of [EleutherAI/gpt-neo-2.7B](https://huggingface.co/EleutherAI/gpt-neo-2.7B) on about 80k WhatsApp and iMessage texts.
- The model is too large to use the inference API. linked [here](https://colab.research.google.com/gist/pszemraj/a59b43813437b43973c8f8f9a3944565/testing-pszemraj-gpt-peter-2-7b.ipynb) is a notebook for testing in Colab.
    - alternatively, you can message [a bot on telegram](http://t.me/GPTPeter_bot) where I test LLMs for dialogue generation
    - the telegram bot code and the model training code can be found [in this repository](https://github.com/pszemraj/ai-msgbot)
                      

## Usage in python 

Install the transformers library if you don't have it:
```
pip install -U transformers
```

load the model into a `pipeline` object:

```
from transformers import pipeline
import torch
my_chatbot = pipeline('text-generation', 
                      'pszemraj/gpt-peter-2.7B',
                      device=0 if torch.cuda.is_available() else -1,
                    )
```

generate text!

```
my_chatbot('Did you ever hear the tragedy of Darth Plagueis The Wise?')
```

_(example above for simplicity, but adding generation parameters such as `no_repeat_ngram_size` are recommended to get better generations)_

## Training procedure


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 6e-05
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- distributed_type: multi-GPU
- gradient_accumulation_steps: 32
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.05
- num_epochs: 1

### Framework versions

- Transformers 4.17.0
- Pytorch 1.10.0+cu113
- Datasets 2.0.0
- Tokenizers 0.11.6