RichardErkhov commited on
Commit
c2bf8aa
1 Parent(s): e53178f

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +174 -0
README.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ janus-dpo-7b - GGUF
11
+ - Model creator: https://huggingface.co/kaist-ai/
12
+ - Original model: https://huggingface.co/kaist-ai/janus-dpo-7b/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [janus-dpo-7b.Q2_K.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q2_K.gguf) | Q2_K | 2.53GB |
18
+ | [janus-dpo-7b.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.IQ3_XS.gguf) | IQ3_XS | 2.81GB |
19
+ | [janus-dpo-7b.IQ3_S.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.IQ3_S.gguf) | IQ3_S | 2.96GB |
20
+ | [janus-dpo-7b.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q3_K_S.gguf) | Q3_K_S | 1.56GB |
21
+ | [janus-dpo-7b.IQ3_M.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.IQ3_M.gguf) | IQ3_M | 3.06GB |
22
+ | [janus-dpo-7b.Q3_K.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q3_K.gguf) | Q3_K | 3.28GB |
23
+ | [janus-dpo-7b.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q3_K_M.gguf) | Q3_K_M | 3.28GB |
24
+ | [janus-dpo-7b.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q3_K_L.gguf) | Q3_K_L | 3.56GB |
25
+ | [janus-dpo-7b.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.IQ4_XS.gguf) | IQ4_XS | 3.67GB |
26
+ | [janus-dpo-7b.Q4_0.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q4_0.gguf) | Q4_0 | 3.83GB |
27
+ | [janus-dpo-7b.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.IQ4_NL.gguf) | IQ4_NL | 3.87GB |
28
+ | [janus-dpo-7b.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q4_K_S.gguf) | Q4_K_S | 3.86GB |
29
+ | [janus-dpo-7b.Q4_K.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q4_K.gguf) | Q4_K | 4.07GB |
30
+ | [janus-dpo-7b.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q4_K_M.gguf) | Q4_K_M | 4.07GB |
31
+ | [janus-dpo-7b.Q4_1.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q4_1.gguf) | Q4_1 | 4.24GB |
32
+ | [janus-dpo-7b.Q5_0.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q5_0.gguf) | Q5_0 | 4.65GB |
33
+ | [janus-dpo-7b.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q5_K_S.gguf) | Q5_K_S | 4.65GB |
34
+ | [janus-dpo-7b.Q5_K.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q5_K.gguf) | Q5_K | 4.78GB |
35
+ | [janus-dpo-7b.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q5_K_M.gguf) | Q5_K_M | 4.78GB |
36
+ | [janus-dpo-7b.Q5_1.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q5_1.gguf) | Q5_1 | 5.07GB |
37
+ | [janus-dpo-7b.Q6_K.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q6_K.gguf) | Q6_K | 5.53GB |
38
+ | [janus-dpo-7b.Q8_0.gguf](https://huggingface.co/RichardErkhov/kaist-ai_-_janus-dpo-7b-gguf/blob/main/janus-dpo-7b.Q8_0.gguf) | Q8_0 | 7.17GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ license: apache-2.0
46
+ base_model: kaist-ai/mpa-Mistral-7b-v0.2-hf-sft-66k
47
+ tags:
48
+ - axolotl
49
+ - trl
50
+ - generated_from_trainer
51
+ - dpo
52
+ model-index:
53
+ - name: janus-dpo-7b
54
+ results: []
55
+ datasets:
56
+ - kaist-ai/Multifaceted-Collection-DPO
57
+ language:
58
+ - en
59
+ library_name: transformers
60
+ pipeline_tag: text-generation
61
+ ---
62
+
63
+ ## Links for Reference
64
+
65
+ - **Homepage: https://lklab.kaist.ac.kr/Janus/**
66
+ - **Repository: https://github.com/kaistAI/Janus**
67
+ - **Paper: https://arxiv.org/abs/2405.17977**
68
+ - **Point of Contact: [email protected]**
69
+
70
+ # TL; DR
71
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6550c4f27bbfce1878f5f280/vrQl8D8FV3vqUJYbPgsiG.png)
72
+
73
+ Janus is a model trained using [Mistral-7B-v0.2](https://huggingface.co/mistral-community/Mistral-7B-v0.2) as its base model. Janus has been trained on [Multifaceted Collection](https://huggingface.co/datasets/kaist-ai/Multifaceted-Collection-SFT), a preference dataset containing 196k unique system messages for aligning LLMs to diverse human preferences. Janus not only excels at generating personalized responses that cater to various human preferences but is also adept at producing responses that are generally preferred for being helpful and harmless.
74
+
75
+ # Model Details
76
+ Janus-DPO-7B is a model created by applying DPO to Janus using the [Multifaceted-Collection-DPO](https://huggingface.co/datasets/kaist-ai/Multifaceted-Collection-DPO).
77
+
78
+ ## Model Description
79
+
80
+ - **Model type:** Language model
81
+ - **Language(s) (NLP):** English
82
+ - **License:** Apache 2.0
83
+ - **Related Models:** [Janus-7B](https://huggingface.co/kaist-ai/janus-7b), [Janus-ORPO-7B](https://huggingface.co/kaist-ai/janus-orpo-7b), [Janus-RM-7B](https://huggingface.co/kaist-ai/janus-rm-7b)
84
+ - **Training Datasets**: [Multifaceted-Collection-DPO](https://huggingface.co/datasets/kaist-ai/Multifaceted-Collection-DPO)
85
+ - **Resources for more information:**
86
+ - [Research paper](https://arxiv.org/abs/2405.17977)
87
+ - [GitHub Repo](https://github.com/kaistAI/Janus)
88
+
89
+ # Usage
90
+ Janus is a model generalized for various system messages, allowing users to control the model's response by inputting the desired system message. The input prompt format is as follows:
91
+ ```
92
+ [INST]{system_message}\n{instruction}[/INST]
93
+ ```
94
+ Additionally, an example of the inference code applying this is as follows:
95
+ ```python
96
+ from transformers import AutoTokenizer, AutoModelForCausalLM
97
+ import torch
98
+
99
+ model_name = "kaist-ai/janus-dpo-7b"
100
+ device = "cuda:0"
101
+
102
+ # Load the model and tokenizer
103
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
104
+
105
+ dtype = "float16"
106
+ if torch.cuda.is_bf16_supported():
107
+ dtype = "bfloat16"
108
+
109
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=getattr(torch, dtype))
110
+ model.eval()
111
+ model.to(device)
112
+
113
+ # Prepare inputs
114
+ system = "As a financial news headline writer with a flair for the dramatic, you have taken on the role of crafting compelling headlines about the integration of AI into the financial sector. Your expertise allows you to weave industry-specific terminology seamlessly into each headline, striking a balance between capturing attention and providing meaningful insights into the transformative benefits of AI in finance. With each headline, you focus on elucidating the key advantages AI brings to financial operations, making complex information accessible and immediately impactful. While your headlines are designed to engage and inform an audience of finance and technology professionals, you navigate the fine line of excitement and accuracy with care, ensuring that the promises made are grounded in reality, thus avoiding any form of sensationalism. Your mission is to distill the essence of AI's impact on finance into a single, powerful line that speaks volumes to the informed reader."
115
+ prompt = "Write a headline for an article about the benefits of using AI in the finance sector."
116
+
117
+ def apply_template_mistral_instruct(system_message, content):
118
+ prompt = f"{system_message}\n{content}".strip()
119
+ return f"[INST] {prompt} [/INST] "
120
+
121
+ input_str = apply_template_mistral_instruct(system, prompt)
122
+ input_ids = tokenizer.encode(input_str, return_tensors="pt")
123
+ print(input_str)
124
+
125
+ model_inputs = input_ids.to(device)
126
+
127
+ # Generate text
128
+ output_ids = model.generate(model_inputs, max_new_tokens=1024)
129
+ decoded = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
130
+ print(decoded[0][len(input_str):])
131
+ # Revolutionary Trends: How AI Is Redefining Efficiency and Accuracy in the Financial Realm
132
+ ```
133
+ To train Janus and evaluate the responses it generates, please refer to the [GitHub Repo](https://github.com/kaistAI/Janus).
134
+ Additionally, refer to the [Multifaceted Bench](https://huggingface.co/datasets/kaist-ai/Multifaceted-Bench), which evaluates how well LLM generates personalized responses.
135
+ # Training Details
136
+ ## Training hyperparameters
137
+
138
+ The following hyperparameters were used during training:
139
+ - learning_rate: 5e-07
140
+ - train_batch_size: 1
141
+ - eval_batch_size: 8
142
+ - seed: 42
143
+ - distributed_type: multi-GPU
144
+ - num_devices: 4
145
+ - gradient_accumulation_steps: 4
146
+ - total_train_batch_size: 16
147
+ - total_eval_batch_size: 32
148
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
149
+ - lr_scheduler_type: cosine
150
+ - lr_scheduler_warmup_steps: 10
151
+ - training_steps: 8143
152
+
153
+ ## Framework versions
154
+
155
+ - Transformers 4.40.0.dev0
156
+ - Pytorch 2.1.1
157
+ - Datasets 2.15.0
158
+ - Tokenizers 0.15.0
159
+
160
+ # Citation
161
+
162
+ If you find the following model helpful, please consider citing our paper!
163
+
164
+ **BibTeX:**
165
+
166
+ ```bibtex
167
+ @article{lee2024aligning,
168
+ title={Aligning to Thousands of Preferences via System Message Generalization},
169
+ author={Lee, Seongyun and Park, Sue Hyun and Kim, Seungone and Seo, Minjoon},
170
+ journal={arXiv preprint arXiv:2405.17977},
171
+ year={2024}
172
+ }
173
+ ```
174
+