RichardErkhov commited on
Commit
d7fa6a3
1 Parent(s): 7cd44af

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +160 -0
README.md ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-1B1 - bnb 4bits
11
+ - Model creator: https://huggingface.co/nicholasKluge/
12
+ - Original model: https://huggingface.co/nicholasKluge/Aira-2-1B1/
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: "Can you explain what is Machine Learning?<|endofinstruction|>"
36
+ example_title: Machine Learning
37
+ - text: "Do you know anything about virtue ethics?<|endofinstruction|>"
38
+ example_title: Ethics
39
+ - text: "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: 1710
52
+ source: CodeCarbon
53
+ training_type: fine-tuning
54
+ geographical_location: Singapore
55
+ hardware_used: NVIDIA A100-SXM4-40GB
56
+ ---
57
+ # Aira-2-1B1
58
+
59
+ Aira-2 is the second version of the Aira instruction-tuned series. Aira-2-1B1 is an instruction-tuned model based on [TinyLlama-1.1B](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T). 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:** 1,261,545,472 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:** 4
70
+ - **Optimizer:** `torch.optim.AdamW` (warmup_steps = 1e2, learning_rate = 5e-4, epsilon = 1e-8)
71
+ - **GPU:** 1 NVIDIA A100-SXM4-40GB
72
+ - **Emissions:** 1.71 KgCO2 (Singapore)
73
+ - **Total Energy Consumption:** 3.51 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-1B1')
90
+ aira = AutoModelForCausalLM.from_pretrained('nicholasKluge/Aira-2-1B1')
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-1B1](https://huggingface.co/nicholasKluge/Aira-2-1B1) | **42.55** | 25.26 | **50.81** | **51.59** |
131
+ | TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T | 37.52 | **30.89** | 39.55 | 42.13 |
132
+
133
+ * Evaluations were performed using the [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) (by [EleutherAI](https://www.eleuther.ai/)).
134
+
135
+ ## Cite as 🤗
136
+
137
+ ```latex
138
+ @misc{nicholas22aira,
139
+ doi = {10.5281/zenodo.6989727},
140
+ url = {https://github.com/Nkluge-correa/Aira},
141
+ author = {Nicholas Kluge Corrêa},
142
+ title = {Aira},
143
+ year = {2023},
144
+ publisher = {GitHub},
145
+ journal = {GitHub repository},
146
+ }
147
+
148
+ @phdthesis{kluge2024dynamic,
149
+ title={Dynamic Normativity},
150
+ author={Kluge Corr{\^e}a, Nicholas},
151
+ year={2024},
152
+ school={Universit{\"a}ts-und Landesbibliothek Bonn}
153
+ }
154
+ ```
155
+
156
+ ## License
157
+
158
+ Aira-2-1B1 is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
159
+
160
+