Seongyun commited on
Commit
e1346d0
1 Parent(s): 6305021

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +85 -99
README.md CHANGED
@@ -4,110 +4,91 @@ base_model: alpindale/Mistral-7B-v0.2-hf
4
  tags:
5
  - axolotl
6
  - generated_from_trainer
 
7
  model-index:
8
- - name: mpa-Mistral-7b-v0.2-hf-sft-66k-orpo
9
  results: []
10
- ---
11
-
12
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
- should probably proofread and complete it, then remove this comment. -->
14
-
15
- [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
16
- <details><summary>See axolotl config</summary>
17
-
18
- axolotl version: `0.4.0`
19
- ```yaml
20
- base_model: alpindale/Mistral-7B-v0.2-hf
21
- model_type: MistralForCausalLM
22
- tokenizer_type: LlamaTokenizer
23
-
24
- load_in_8bit: false
25
- load_in_4bit: false
26
- strict: false
27
-
28
- rl: orpo
29
- orpo_alpha: 0.1
30
- remove_unused_columns: false
31
- chat_template: chatml
32
  datasets:
33
- - path: /mnt/nas/seongyun/MPA/data/training/preferences_v1_responses_for_orpo_64k_v2.jsonl
34
- type: orpo.chat_template
35
- # conversation: mistral
36
-
37
- dataset_prepared_path:
38
- hub_model_id: kaist-ai/mpa-Mistral-7b-v0.2-hf-sft-66k-orpo
39
- hub_strategy: checkpoint
40
- # val_set_size: 0
41
- output_dir: /mnt/nas/seongyun/axolotl/outputs/mpa_66k_orpo
42
-
43
- sequence_len: 4096
44
- sample_packing: false
45
- pad_to_sequence_len: true
46
- eval_sample_packing: false
47
-
48
- wandb_project: mpa
49
- wandb_entity: seongyun
50
- wandb_watch:
51
- wandb_name: mpa_mistral-7b-v0.2-hf-66k-orpo
52
- wandb_log_model:
53
-
54
- gradient_accumulation_steps: 4
55
- micro_batch_size: 1
56
- num_epochs: 2
57
- optimizer: adamw_bnb_8bit
58
- lr_scheduler: cosine
59
- learning_rate: 0.000005
60
-
61
- train_on_inputs: false
62
- group_by_length: false
63
- bf16: auto
64
- fp16:
65
- tf32: false
66
-
67
- gradient_checkpointing: true
68
- early_stopping_patience:
69
- resume_from_checkpoint:
70
- local_rank:
71
- logging_steps: 1
72
- xformers_attention:
73
- flash_attention: true
74
-
75
- warmup_steps: 10
76
- # evals_per_epoch: 4
77
- eval_table_size:
78
- # eval_max_new_tokens: 128
79
- saves_per_epoch: 1
80
- debug:
81
- deepspeed:
82
- weight_decay: 0.0
83
- fsdp:
84
- fsdp_config:
85
- special_tokens:
86
-
87
- ```
88
-
89
- </details><br>
90
-
91
- # mpa-Mistral-7b-v0.2-hf-sft-66k-orpo
92
-
93
- This model is a fine-tuned version of [alpindale/Mistral-7B-v0.2-hf](https://huggingface.co/alpindale/Mistral-7B-v0.2-hf) on the None dataset.
94
-
95
- ## Model description
96
-
97
- More information needed
98
 
99
- ## Intended uses & limitations
100
 
101
- More information needed
 
 
 
102
 
103
- ## Training and evaluation data
 
104
 
105
- More information needed
106
 
107
- ## Training procedure
 
 
108
 
109
- ### Training hyperparameters
 
 
 
 
 
 
 
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  The following hyperparameters were used during training:
112
  - learning_rate: 5e-06
113
  - train_batch_size: 1
@@ -123,13 +104,18 @@ The following hyperparameters were used during training:
123
  - lr_scheduler_warmup_steps: 10
124
  - num_epochs: 2
125
 
126
- ### Training results
127
-
128
-
129
-
130
- ### Framework versions
131
 
132
  - Transformers 4.40.0.dev0
133
  - Pytorch 2.2.2
134
  - Datasets 2.18.0
135
  - Tokenizers 0.15.0
 
 
 
 
 
 
 
 
 
 
4
  tags:
5
  - axolotl
6
  - generated_from_trainer
7
+ - orpo
8
  model-index:
9
+ - name: janus-orpo-7b
10
  results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  datasets:
12
+ - kaist-ai/Multifaceted-Collection-ORPO
13
+ language:
14
+ - en
15
+ library_name: transformers
16
+ pipeline_tag: text-generation
17
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
+ ## Links for Reference
20
 
21
+ - **Homepage: In Progress**
22
+ - **Repository: https://github.com/kaistAI/Janus**
23
+ - **Paper:**
24
+ - **Point of Contact:[email protected]**
25
 
26
+ # TL; DR
27
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6550c4f27bbfce1878f5f280/vrQl8D8FV3vqUJYbPgsiG.png)
28
 
29
+ 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 192k 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.
30
 
31
+ # Model Details
32
+ Janus-ORPO is a model created by applying ORPO to Mistral-7B-v0.2 using the Multifaceted-Collection-ORPO.
33
+ ## Model Description
34
 
35
+ - **Model type:** Language model
36
+ - **Language(s) (NLP):** English
37
+ - **License:** Apache 2.0
38
+ - **Related Models:** [Janus-66k-7B]() [Janus-DPO-7B](), [Janus-7B](), [Janus-RM-7B]()
39
+ - **Training Datasets**: [Multifaceted-Collection-SFT](https://huggingface.co/datasets/kaist-ai/Multifaceted-Collection-SFT)
40
+ - **Resources for more information:**
41
+ - [Research paper]()
42
+ - [GitHub Repo](https://github.com/kaistAI/Janus)
43
 
44
+ # Usage
45
+ 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:
46
+ ```
47
+ [INST]{system_message}\n{instruction}[/INST]
48
+ ```
49
+ Additionally, an example of the inference code applying this is as follows:
50
+ ```
51
+ from transformers import AutoTokenizer, AutoModelForCausalLM
52
+ import torch
53
+
54
+ model_name = "kaist-ai/janus-orpo-7b"
55
+ device = "cuda:0"
56
+
57
+ # Load the model and tokenizer
58
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
59
+
60
+ dtype = "float16"
61
+ if torch.cuda.is_bf16_supported():
62
+ dtype = "bfloat16"
63
+
64
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=getattr(torch, dtype))
65
+ model.eval()
66
+ model.to(device)
67
+
68
+ # Prepare inputs
69
+ 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."
70
+ prompt = "Write a headline for an article about the benefits of using AI in the finance sector."
71
+
72
+ def apply_template_mistral_instruct(system_message, content):
73
+ prompt = f"{system_message}\n{content}".strip()
74
+ return f"[INST] {prompt} [/INST] "
75
+
76
+ input_str = apply_template_mistral_instruct(system, prompt)
77
+ input_ids = tokenizer.encode(input_str, return_tensors="pt")
78
+ print(input_str)
79
+
80
+ model_inputs = input_ids.to(device)
81
+
82
+ # Generate text
83
+ output_ids = model.generate(model_inputs, max_new_tokens=1024)
84
+ decoded = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
85
+ print(decoded[0][len(input_str):])
86
+ # Revolutionary Trends: How AI Is Redefining Efficiency and Accuracy in the Financial Realm
87
+ ```
88
+ To train Janus and evaluate the responses it generates, please refer to the [GitHub Repo](https://github.com/kaistAI/Janus).
89
+ Additionally, refer to the [Multifaceted Bench](https://huggingface.co/datasets/kaist-ai/Multifaceted-Bench), which evaluates how well LLM generates personalized responses.
90
+ # Training Details
91
+ ## Training hyperparameters
92
  The following hyperparameters were used during training:
93
  - learning_rate: 5e-06
94
  - train_batch_size: 1
 
104
  - lr_scheduler_warmup_steps: 10
105
  - num_epochs: 2
106
 
107
+ ## Framework versions
 
 
 
 
108
 
109
  - Transformers 4.40.0.dev0
110
  - Pytorch 2.2.2
111
  - Datasets 2.18.0
112
  - Tokenizers 0.15.0
113
+
114
+ # Citation
115
+
116
+ If you find the following model helpful, please consider citing our paper!
117
+
118
+ **BibTeX:**
119
+
120
+ ```bibtex
121
+ ```