TehVenom commited on
Commit
af4ac4f
1 Parent(s): 6478848

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +149 -0
README.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ thumbnail: null
5
+ tags:
6
+ - text generation
7
+ - instruct
8
+ pipeline_tag: text-generation
9
+ inference: false
10
+ ---
11
+ <h1 style="text-align: center">Metharme 13b</h1>
12
+ <h2 style="text-align: center">An instruction-tuned LLaMA biased towards fiction writing and conversation.</h2>
13
+
14
+ ## Model Details:
15
+
16
+ Converted from the XORs weights from PygmalionAI's release https://huggingface.co/PygmalionAI/metharme-13b
17
+
18
+
19
+ Metharme 13b is an instruct model based on Meta's LLaMA-13b.
20
+
21
+ This is an experiment to try and get a model that is usable for conversation, roleplaying and storywriting, but which can be guided using natural language like other instruct models. See the [prompting](#prompting) section below for examples.
22
+
23
+ It was trained by doing supervised fine-tuning over a mixture of regular instruction data alongside roleplay, fictional stories and conversations with synthetically generated instructions attached.
24
+
25
+ The current Metharme-13b has been trained as a LoRA, then merged down to the base model for distribuition.
26
+
27
+ It has also been quantized down to 4Bit using the GPTQ library available here: https://github.com/0cc4m/GPTQ-for-LLaMa
28
+ ```
29
+ python -m gptq.llama .\TehVenom_Metharme-13b-Merged c4 --wbits 4 --true-sequential --groupsize 128 --save_safetensors Metharme-13b-GPTQ-4bit-128g.no-act-order.safetensors
30
+ ```
31
+
32
+ ## Prompting
33
+
34
+ The current model version has been trained on prompts using three different roles, which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.
35
+
36
+ The `<|system|>` prompt can be used to inject out-of-channel information behind the scenes, while the `<|user|>` prompt should be used to indicate user input. The `<|model|>` token should then be used to indicate that the model should generate a response. These tokens can happen multiple times and be chained up to form a conversation history.
37
+
38
+ ### Prompting example
39
+
40
+ Here's a concrete example. Let's say you have the following system prompt:
41
+
42
+ > This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.
43
+
44
+ And the user has typed in the following message:
45
+
46
+ > Start!
47
+
48
+ To perform inference against the model, the prompt should be formatted like this:
49
+ ```
50
+ <|system|>This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.<|user|>Start!<|model|>
51
+ ```
52
+
53
+ The model might generate something like:
54
+
55
+ > You are standing in front of an old, abandoned house. The windows are boarded up, and there's no sign of life around it. As you approach, you notice a strange feeling emanating from within. Suddenly, you hear a voice calling out to you... 'Come inside!'
56
+ >
57
+ > - Go inside the house.
58
+ > - Ignore the call and move away.
59
+ > - Run as fast as you can.
60
+
61
+ It will automatically emit an end-of-text token (`</s>`) when it judges that the response is complete.
62
+
63
+ Pretend then that the user has replied with `go inside`. The next prompt should then be:
64
+
65
+ ```
66
+ <|system|>This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.<|user|>Start!<|model|>You are standing in front of an old, abandoned house. The windows are boarded up, and there's no sign of life around it. As you approach, you notice a strange feeling emanating from within. Suddenly, you hear a voice calling out to you... 'Come inside!'
67
+
68
+ - Go inside the house.
69
+ - Ignore the call and move away.
70
+ - Run as fast as you can.<|user|>go inside<|model|>
71
+ ```
72
+
73
+ Which might generate something like:
74
+
75
+ > You enter the house, and immediately, a wave of unsettling energy washes over you. Your senses seem heightened, but your mind feels foggy. A figure appears before you - a tall man with piercing eyes. He speaks to you in a language you don't understand.
76
+ >
77
+ > - Ask him what he wants.
78
+ > - Attack him.
79
+ > - Run away.
80
+
81
+ Same process applies. Usually, it is best to do a sliding window over the user and model turns, but keep the system prompt fixed at the start of the context window.
82
+
83
+ ## Eval / Benchmark scores
84
+
85
+ Current evals out of the Metharme-13b model: <br>
86
+ <html>
87
+ <head>
88
+ <style>
89
+ table {
90
+ border:1px solid #b3adad;
91
+ border-collapse:collapse;
92
+ padding:5px;
93
+ }
94
+ table th {
95
+ border:1px solid #b3adad;
96
+ padding:5px;
97
+ background: #f0f0f0;
98
+ color: #313030;
99
+ }
100
+ table td {
101
+ border:1px solid #b3adad;
102
+ text-align:center;
103
+ padding:5px;
104
+ background: #ffffff;
105
+ color: #313030;
106
+ }
107
+ </style>
108
+ </head>
109
+ <body>
110
+ <table>
111
+ <thead>
112
+ <tr>
113
+ <th>Model:</th>
114
+ <th>Wikitext2</th>
115
+ <th>Ptb-New</th>
116
+ <th>C4-New</th>
117
+ </tr>
118
+ </thead>
119
+ <tbody>
120
+ <tr>
121
+ <td>Metharme 13b - 16bit</td>
122
+ <td>5.253076553344727</td>
123
+ <td>27.53407859802246</td>
124
+ <td>7.038073539733887</td>
125
+ </tr>
126
+ <tr>
127
+ <td>Metharme 13b - 4bit - [true-sequential & 128g]</td>
128
+ <td>TBD</td>
129
+ <td>TBD</td>
130
+ <td>TBD</td>
131
+ </tr>
132
+ </tbody>
133
+ </table>
134
+ </body>
135
+ </html>
136
+
137
+ <hr>
138
+
139
+ ## Other notes
140
+
141
+ - When prompted correctly, the model will always start by generating a BOS token. This behavior is an accidental side-effect which we plan to address in future model versions and should not be relied upon.
142
+ - The model was trained as a LoRA with a somewhat unorthodox configuration which causes errors when used with the current version of `peft`, hence we release it as a full model instead.
143
+
144
+
145
+ ## Limitations and biases
146
+
147
+ The intended use-case for this model is fictional writing for entertainment purposes. Any other sort of usage is out of scope.
148
+
149
+ As such, it was **not** fine-tuned to be safe and harmless: the base model _and_ this fine-tune have been trained on data known to contain profanity and texts that are lewd or otherwise offensive. It may produce socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. Outputs might often be factually wrong or misleading.