dorkai commited on
Commit
33d6444
·
1 Parent(s): 3b0e669

Upload 8 files

Browse files
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: creativeml-openrail-m
3
+ language:
4
+ - en
5
+ thumbnail:
6
+ tags:
7
+ - text generation
8
+ - conversational
9
+ inference: false
10
+ ---
11
+
12
+ # Pygmalion 2.7B
13
+
14
+ ## Model description
15
+
16
+ Pymalion 2.7B is a proof-of-concept dialogue model based on EleutherAI's [gpt-neo-2.7B](https://huggingface.co/EleutherAI/gpt-neo-2.7B).
17
+
18
+ **Warning:** This model is **NOT** suitable for use by minors. It **will** output X-rated content under certain circumstances.
19
+
20
+ ## Training data
21
+
22
+ The fine-tuning dataset consisted of 56MB of dialogue data gathered from multiple sources, which includes both real _and_ partially machine-generated conversations.
23
+
24
+ ## Training procedure
25
+
26
+ Model weights were initialized from the `uft-2.7b` ConvoGPT model made available in [this commit](https://huggingface.co/hakurei/convogpt/tree/07707377dee0aa7d1ee5363ef660b13eb5b73f9d/2.7b-uft).
27
+
28
+ The model was then further fine-tuned on ~48.5 million tokens for ~5k steps on 4 NVIDIA A40s using DeepSpeed.
29
+
30
+ ## Intended use
31
+
32
+ ### The easy way
33
+
34
+ We provide a notebook with a Gradio UI for playing around with the model without having to manually format inputs. This notebook can be found [here](https://github.com/PygmalionAI/gradio-ui/blob/master/notebooks/GPU.ipynb).
35
+
36
+ ### The manual way
37
+
38
+ The model can be used as a regular text generation model, but it'll perform best if the input prompt adheres to the following format:
39
+
40
+ ```
41
+ [CHARACTER]'s Persona: [A few sentences about the character you want the model to play]
42
+ <START>
43
+ [DIALOGUE HISTORY]
44
+ You: [Your input message here]
45
+ [CHARACTER]:
46
+ ```
47
+
48
+ Where `[CHARACTER]` is, as you can probably guess, the name of the character you want the model to portray, `<START>` should be used verbatim as a delimiter token to separate persona and scenario data from the dialogue, and `[DIALOGUE HISTORY]` is chat history so the model can have some conversational context to draw from. Ideally it'll be pairs of messages like:
49
+
50
+ ```
51
+ [CHARACTER]: [some dialogue here]
52
+ You: [your response to the dialogue above]
53
+ ```
54
+
55
+ Apart from chat history, you can also just add example conversations in `[DIALOGUE HISTORY]` to show how the character should speak - ideally at the beginning, so it doesn't get confused as to what's conversation history vs. character definition.
56
+
57
+ ## Known issues
58
+
59
+ We haven't played around with the model enough to enumerate them. Feel free to give us some feedback!
config.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "pygmalion-2.7b",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPTNeoForCausalLM"
6
+ ],
7
+ "attention_dropout": 0,
8
+ "attention_layers": [
9
+ "global",
10
+ "local",
11
+ "global",
12
+ "local",
13
+ "global",
14
+ "local",
15
+ "global",
16
+ "local",
17
+ "global",
18
+ "local",
19
+ "global",
20
+ "local",
21
+ "global",
22
+ "local",
23
+ "global",
24
+ "local",
25
+ "global",
26
+ "local",
27
+ "global",
28
+ "local",
29
+ "global",
30
+ "local",
31
+ "global",
32
+ "local",
33
+ "global",
34
+ "local",
35
+ "global",
36
+ "local",
37
+ "global",
38
+ "local",
39
+ "global",
40
+ "local"
41
+ ],
42
+ "attention_types": [
43
+ [
44
+ [
45
+ "global",
46
+ "local"
47
+ ],
48
+ 16
49
+ ]
50
+ ],
51
+ "bos_token_id": 50256,
52
+ "embed_dropout": 0,
53
+ "eos_token_id": 50256,
54
+ "hidden_size": 2560,
55
+ "initializer_range": 0.02,
56
+ "intermediate_size": null,
57
+ "layer_norm_epsilon": 1e-05,
58
+ "max_position_embeddings": 2048,
59
+ "model_type": "gpt_neo",
60
+ "num_heads": 20,
61
+ "num_layers": 32,
62
+ "resid_dropout": 0,
63
+ "summary_activation": null,
64
+ "summary_first_dropout": 0.1,
65
+ "summary_proj_to_labels": true,
66
+ "summary_type": "cls_index",
67
+ "summary_use_proj": true,
68
+ "task_specific_params": {
69
+ "text-generation": {
70
+ "do_sample": true,
71
+ "max_length": 50,
72
+ "temperature": 0.9
73
+ }
74
+ },
75
+ "tokenizer_class": "GPT2Tokenizer",
76
+ "torch_dtype": "float16",
77
+ "transformers_version": "4.26.0.dev0",
78
+ "use_cache": false,
79
+ "vocab_size": 50257,
80
+ "window_size": 256
81
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77a15cdb3624975045d1003f4a725e1eb809ce4e437d4789b6053170e3eeaafd
3
+ size 135
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "pad_token": "<|endoftext|>",
5
+ "unk_token": "<|endoftext|>"
6
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "bos_token": {
4
+ "__type": "AddedToken",
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false
10
+ },
11
+ "eos_token": {
12
+ "__type": "AddedToken",
13
+ "content": "",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "errors": "replace",
20
+ "model_max_length": 2048,
21
+ "name_or_path": "pygmalion-2.7b",
22
+ "pad_token": "",
23
+ "special_tokens_map_file": null,
24
+ "tokenizer_class": "GPT2Tokenizer",
25
+ "unk_token": {
26
+ "__type": "AddedToken",
27
+ "content": "<|endoftext|>",
28
+ "lstrip": false,
29
+ "normalized": true,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff