Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,123 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
### Model Description
|
15 |
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
29 |
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
|
32 |
-
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
-
|
37 |
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
43 |
|
44 |
-
[More Information Needed]
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
-
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
|
62 |
-
[More Information Needed]
|
63 |
|
64 |
-
|
65 |
|
66 |
-
|
67 |
|
68 |
-
|
69 |
|
70 |
-
|
71 |
|
72 |
-
|
73 |
|
74 |
-
[More Information Needed]
|
75 |
|
76 |
-
##
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
|
|
81 |
|
82 |
-
|
|
|
|
|
|
|
83 |
|
84 |
-
|
|
|
85 |
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
-
|
|
|
|
|
|
|
89 |
|
90 |
-
[More Information Needed]
|
91 |
|
|
|
92 |
|
93 |
-
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
model_name: Vikhr-Llama-3.2-1B-Instruct-abliterated
|
4 |
+
base_model:
|
5 |
+
- Vikhrmodels/Vikhr-Llama-3.2-1B-Instruct
|
6 |
+
language:
|
7 |
+
- ru
|
8 |
+
- en
|
9 |
+
license: llama3.2
|
10 |
+
tags:
|
11 |
+
- not-for-all-audiences
|
12 |
---
|
13 |
|
14 |
+
# 💨🔞 Vikhr-Llama-3.2-1B-Instruct-Abliterated
|
15 |
|
16 |
+
#### RU
|
17 |
|
18 |
+
Инструктивная модель на основе **Vikhr-Llama-3.2-1B-Instruct**, прошедшая процесс "аблитерации" для снятия цензурных ограничений, обучена на русскоязычном датасете **GrandMaster-PRO-MAX**.
|
19 |
|
20 |
+
#### EN
|
21 |
|
22 |
+
A fine-tuned instruction-following model based on **Vikhr-Llama-3.2-1B-Instruct**, which has undergone "abliteration" to remove censorship restrictions. Trained on the **GrandMaster-PRO-MAX**.
|
23 |
|
|
|
24 |
|
25 |
+
# 🛑 Отказ от ответственности / Disclaimer
|
26 |
+
#### RU
|
27 |
+
Модель **Vikhr-Llama-3.2-1B-Instruct-abliterated** разработана исключительно для исследовательских и образовательных целей. После применения метода "аблитерации" модель больше не имеет встроенных ограничений на генерацию ответов, что может привести к созданию нежелательных или потенциально вредоносных текстов.
|
28 |
|
29 |
+
Использование модели происходит на ваш собственный риск. Разработчики и авторы не несут ответственности за любой вред, ущерб или последствия, вызванные использованием модели, включая её применение в контекстах, противоречащих законам, этическим или моральным нормам.
|
30 |
|
31 |
+
#### EN
|
32 |
+
The **Vikhr-Llama-3.2-1B-Instruct-abliterated** model is intended solely for research and educational purposes. After the "abliteration" technique is applied, the model no longer has built-in restrictions on generating responses, which may result in unwanted or potentially harmful outputs.
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
Use of the model is at your own risk. The developers and authors are not responsible for any damage, harm, or consequences resulting from its use, including use in contexts that violate laws, ethical standards, or moral norms.
|
35 |
|
|
|
36 |
|
37 |
+
## GGUF
|
|
|
|
|
38 |
|
39 |
+
- [Vikhrmodels/Vikhr-Llama-3.2-1B-Instruct-Abliterated-GGUF](https://huggingface.co/Vikhrmodels/Vikhr-Llama-3.2-1B-Instruct-abliterated-GGUF)
|
40 |
|
|
|
41 |
|
42 |
+
## Основные особенности / Key Features:
|
43 |
|
44 |
+
- 📚 Основа / Base: [Vikhr-Llama-3.2-1B-Instruct](https://huggingface.co/Vikhrmodels/Vikhr-Llama-3.2-1B-Instruct)
|
45 |
+
- 🇷🇺 Специализация / Specialization: **RU**
|
46 |
|
|
|
47 |
|
48 |
+
## Попробовать / Try now:
|
49 |
|
50 |
+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1bJpLmplDGkMbfOLO2CH6IO-2uUZEaknf?usp=sharing)
|
51 |
|
|
|
52 |
|
53 |
+
## Описание / Description:
|
54 |
|
55 |
+
#### RU
|
56 |
|
57 |
+
**Vikhr-Llama-3.2-1B-Instruct-Abliterated** — это компактная языковая модель, обученная на датасете **GrandMaster-PRO-MAX** с применением техники "аблитерации," которая снимает ограничения цензуры модели. Этот процесс делает её значительно более гибкой и способной отвечать на любые запросы. Модель занимает менее 3GB и идеально подходит для работы на слабых устройствах.
|
58 |
|
59 |
+
#### EN
|
60 |
|
61 |
+
**Vikhr-Llama-3.2-1B-Instruct-Abliterated** is a compact language model fine-tuned on the **GrandMaster-PRO-MAX** dataset with the "abliteration" technique, which removes censorship restrictions. This process significantly increases the model's flexibility, enabling it to respond to any prompt. The model size is under 3GB, making it an excellent choice for deployment on low-power devices.
|
62 |
|
|
|
63 |
|
64 |
+
## Обучение / Training:
|
65 |
|
66 |
+
#### RU
|
67 |
|
68 |
+
Модель **Vikhr-Llama-3.2-1B-Instruct-Abliterated** прошла процесс "аблитерации", что позволило снять ограничения на обработку вредоносных инструкций. Эта техника была взята из статьи **[Uncensor any LLM with abliteration](https://huggingface.co/blog/mlabonne/abliteration)**, которая описывает, как идентифицировать и устранять так называемое "направление отказа" модели, предотвращающее выполнение вредоносных запросов.
|
69 |
|
70 |
+
#### EN
|
71 |
|
72 |
+
The **Vikhr-Llama-3.2-1B-Instruct-Abliterated** model was processed using the "abliteration" technique, which removes restrictions on handling harmful instructions. This technique was inspired by the article **[Uncensor any LLM with abliteration](https://huggingface.co/blog/mlabonne/abliteration)**, detailing how to identify and ablate the "refusal direction" in the model's residual streams to enable uncensored responses.
|
73 |
|
|
|
74 |
|
75 |
+
## Пример кода для запуска / Sample code to run:
|
76 |
|
77 |
+
**Рекомендуемая температура для генерации: 0.3** / **Recommended generation temperature: 0.3**
|
78 |
|
79 |
+
```python
|
80 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
81 |
|
82 |
+
# Загрузка модели и токенизатора
|
83 |
+
model_name = "Vikhrmodels/Vikhr-Llama-3.2-1B-instruct"
|
84 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
85 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
86 |
|
87 |
+
# Подготовка входного текста
|
88 |
+
input_text = "Напиши очень краткую рецензию о книге гарри поттер."
|
89 |
|
90 |
+
# Токенизация и генерация текста
|
91 |
+
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
92 |
+
output = model.generate(
|
93 |
+
input_ids,
|
94 |
+
max_length=1512,
|
95 |
+
temperature=0.3,
|
96 |
+
num_return_sequences=1,
|
97 |
+
no_repeat_ngram_size=2,
|
98 |
+
top_k=50,
|
99 |
+
top_p=0.95,
|
100 |
+
)
|
101 |
|
102 |
+
# Декодирование и вывод результата
|
103 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
104 |
+
print(generated_text)
|
105 |
+
```
|
106 |
|
|
|
107 |
|
108 |
+
### Авторы / Authors
|
109 |
|
110 |
+
- Sergei Bratchikov, [NLP Wanderer](https://t.me/nlpwanderer), [Vikhr Team](https://t.me/vikhrlabs)
|
111 |
+
- Nikolay Kompanets, [LakoMoor](https://t.me/lakomoor), [Vikhr Team](https://t.me/vikhrlabs)
|
112 |
+
- Konstantin Korolev, [Vikhr Team](https://t.me/vikhrlabs)
|
113 |
+
- Aleksandr Nikolich, [Vikhr Team](https://t.me/vikhrlabs)
|
114 |
|
115 |
+
```
|
116 |
+
@article{nikolich2024vikhr,
|
117 |
+
title={Vikhr: The Family of Open-Source Instruction-Tuned Large Language Models for Russian},
|
118 |
+
author={Aleksandr Nikolich and Konstantin Korolev and Sergey Bratchikov and Nikolay Kompanets and Artem Shelmanov},
|
119 |
+
journal={arXiv preprint arXiv:2405.13929},
|
120 |
+
year={2024},
|
121 |
+
url={https://arxiv.org/pdf/2405.13929}
|
122 |
+
}
|
123 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|