RichardErkhov commited on
Commit
b0c8599
1 Parent(s): 5818f74

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +167 -0
README.md ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ Aira-2-774M - bnb 8bits
11
+ - Model creator: https://huggingface.co/nicholasKluge/
12
+ - Original model: https://huggingface.co/nicholasKluge/Aira-2-774M/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ license: apache-2.0
20
+ datasets:
21
+ - nicholasKluge/instruct-aira-dataset
22
+ language:
23
+ - en
24
+ metrics:
25
+ - accuracy
26
+ library_name: transformers
27
+ tags:
28
+ - alignment
29
+ - instruction tuned
30
+ - text generation
31
+ - conversation
32
+ - assistant
33
+ pipeline_tag: text-generation
34
+ widget:
35
+ - text: "<|startofinstruction|>Can you explain what is Machine Learning?<|endofinstruction|>"
36
+ example_title: Machine Learning
37
+ - text: "<|startofinstruction|>Do you know anything about virtue ethics?<|endofinstruction|>"
38
+ example_title: Ethics
39
+ - text: "<|startofinstruction|>How can I make my girlfriend happy?<|endofinstruction|>"
40
+ example_title: Advise
41
+ inference:
42
+ parameters:
43
+ repetition_penalty: 1.2
44
+ temperature: 0.2
45
+ top_k: 30
46
+ top_p: 0.3
47
+ max_new_tokens: 200
48
+ length_penalty: 0.3
49
+ early_stopping: true
50
+ co2_eq_emissions:
51
+ emissions: 770
52
+ source: CodeCarbon
53
+ training_type: fine-tuning
54
+ geographical_location: United States of America
55
+ hardware_used: NVIDIA A100-SXM4-40GB
56
+ ---
57
+ # Aira-2-774M
58
+
59
+ Aira-2 is the second version of the Aira instruction-tuned series. Aira-2-774M is an instruction-tuned model based on [GPT-2](https://huggingface.co/gpt2-large). The model was trained with a dataset composed of prompts and completions generated synthetically by prompting already-tuned models (ChatGPT, Llama, Open-Assistant, etc).
60
+
61
+ Check our gradio-demo in [Spaces](https://huggingface.co/spaces/nicholasKluge/Aira-Demo).
62
+
63
+ ## Details
64
+
65
+ - **Size:** 774,032,640 parameters
66
+ - **Dataset:** [Instruct-Aira Dataset](https://huggingface.co/datasets/nicholasKluge/instruct-aira-dataset)
67
+ - **Language:** English
68
+ - **Number of Epochs:** 3
69
+ - **Batch size:** 8
70
+ - **Optimizer:** `torch.optim.AdamW` (warmup_steps = 1e2, learning_rate = 5e-4, epsilon = 1e-8)
71
+ - **GPU:** 1 NVIDIA A100-SXM4-40GB
72
+ - **Emissions:** 0.77 KgCO2 (Singapore)
73
+ - **Total Energy Consumption:** 1.58 kWh
74
+
75
+ This repository has the [source code](https://github.com/Nkluge-correa/Aira) used to train this model.
76
+
77
+ ## Usage
78
+
79
+ Three special tokens are used to mark the user side of the interaction and the model's response:
80
+
81
+ `<|startofinstruction|>`What is a language model?`<|endofinstruction|>`A language model is a probability distribution over a vocabulary.`<|endofcompletion|>`
82
+
83
+ ```python
84
+ from transformers import AutoTokenizer, AutoModelForCausalLM
85
+ import torch
86
+
87
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
88
+
89
+ tokenizer = AutoTokenizer.from_pretrained('nicholasKluge/Aira-2-774M')
90
+ aira = AutoModelForCausalLM.from_pretrained('nicholasKluge/Aira-2-774M')
91
+
92
+ aira.eval()
93
+ aira.to(device)
94
+
95
+ question = input("Enter your question: ")
96
+
97
+ inputs = tokenizer(tokenizer.bos_token + question + tokenizer.sep_token,
98
+ add_special_tokens=False,
99
+ return_tensors="pt").to(device)
100
+
101
+ responses = aira.generate(**inputs, num_return_sequences=2)
102
+
103
+ print(f"Question: 👤 {question}\n")
104
+
105
+ for i, response in enumerate(responses):
106
+ print(f'Response {i+1}: 🤖 {tokenizer.decode(response, skip_special_tokens=True).replace(question, "")}')
107
+ ```
108
+
109
+ The model will output something like:
110
+
111
+ ```markdown
112
+ >>>Question: 👤 What is the capital of Brazil?
113
+
114
+ >>>Response 1: 🤖 The capital of Brazil is Brasília.
115
+ >>>Response 2: 🤖 The capital of Brazil is Brasília.
116
+ ```
117
+
118
+ ## Limitations
119
+
120
+ - **Hallucinations:** This model can produce content that can be mistaken for truth but is, in fact, misleading or entirely false, i.e., hallucination.
121
+
122
+ - **Biases and Toxicity:** This model inherits the social and historical stereotypes from the data used to train it. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.
123
+
124
+ - **Repetition and Verbosity:** The model may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.
125
+
126
+ ## Evaluation
127
+
128
+ |Model |Average |[ARC](https://arxiv.org/abs/1803.05457) |[TruthfulQA](https://arxiv.org/abs/2109.07958) |[ToxiGen](https://arxiv.org/abs/2203.09509) |
129
+ | ---------------------------------------------------------------------- | -------- | -------------------------------------- | --------------------------------------------- | ------------------------------------------ |
130
+ |[Aira-2-124M-DPO](https://huggingface.co/nicholasKluge/Aira-2-124M-DPO) |**40.68** |**24.66** |**42.61** |**54.79** |
131
+ |[Aira-2-124M](https://huggingface.co/nicholasKluge/Aira-2-124M) |38.07 |24.57 |41.02 |48.62 |
132
+ |GPT-2 |35.37 |21.84 |40.67 |43.62 |
133
+ |[Aira-2-355M](https://huggingface.co/nicholasKluge/Aira-2-355M) |**39.68** |**27.56** |38.53 |**53.19** |
134
+ |GPT-2-medium |36.43 |27.05 |**40.76** |41.49 |
135
+ |[Aira-2-774M](https://huggingface.co/nicholasKluge/Aira-2-774M) |**42.26** |**28.75** |**41.33** |**56.70** |
136
+ |GPT-2-large |35.16 |25.94 |38.71 |40.85 |
137
+ |[Aira-2-1B5](https://huggingface.co/nicholasKluge/Aira-2-1B5) |**42.22** |28.92 |**41.16** |**56.60** |
138
+ |GPT-2-xl |36.84 |**30.29** |38.54 |41.70 |
139
+
140
+ * Evaluations were performed using the [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) (by [EleutherAI](https://www.eleuther.ai/)).
141
+
142
+ ## Cite as 🤗
143
+
144
+ ```latex
145
+ @misc{nicholas22aira,
146
+ doi = {10.5281/zenodo.6989727},
147
+ url = {https://github.com/Nkluge-correa/Aira},
148
+ author = {Nicholas Kluge Corrêa},
149
+ title = {Aira},
150
+ year = {2023},
151
+ publisher = {GitHub},
152
+ journal = {GitHub repository},
153
+ }
154
+
155
+ @phdthesis{kluge2024dynamic,
156
+ title={Dynamic Normativity},
157
+ author={Kluge Corr{\^e}a, Nicholas},
158
+ year={2024},
159
+ school={Universit{\"a}ts-und Landesbibliothek Bonn}
160
+ }
161
+ ```
162
+
163
+ ## License
164
+
165
+ Aira-2-774M is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
166
+
167
+