Update LMFlow support

#10
Files changed (1) hide show
  1. README.md +34 -0
README.md CHANGED
@@ -145,6 +145,40 @@ The prompt template used by Hymba-1.5B-Instruct is as follows, which has been in
145
  ```
146
 
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  ## Limitations
149
  The model was trained on data that contains toxic language, unsafe content, and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
150
 
 
145
  ```
146
 
147
 
148
+ ## Finetuning Hymba
149
+
150
+
151
+ [LMFlow](https://github.com/OptimalScale/LMFlow) is a complete pipeline for fine-tuning large language models.
152
+ The following steps provide an example of how to fine-tune the `Hymba-1.5B-Base` models using LMFlow.
153
+
154
+ 1. Using Docker
155
+
156
+ ```
157
+ docker pull ghcr.io/tilmto/hymba:v1
158
+ docker run --gpus all -v /home/$USER:/home/$USER -it ghcr.io/tilmto/hymba:v1 bash
159
+ ```
160
+ 2. Install LMFlow
161
+
162
+ ```
163
+ git clone https://github.com/OptimalScale/LMFlow.git
164
+ cd LMFlow
165
+ conda create -n lmflow python=3.9 -y
166
+ conda activate lmflow
167
+ conda install mpi4py
168
+ pip install -e .
169
+ ```
170
+
171
+ 3. Fine-tune the model using the following command.
172
+
173
+ ```
174
+ cd LMFlow
175
+ bash ./scripts/run_finetune_hymba.sh
176
+ ```
177
+
178
+ With LMFlow, you can also fine-tune the model on your custom dataset. The only thing you need to do is transform your dataset into the [LMFlow data format](https://optimalscale.github.io/LMFlow/examples/DATASETS.html).
179
+ In addition to full-finetuniing, you can also fine-tune hymba efficiently with [DoRA](https://arxiv.org/html/2402.09353v4), [LoRA](https://github.com/OptimalScale/LMFlow?tab=readme-ov-file#lora), [LISA](https://github.com/OptimalScale/LMFlow?tab=readme-ov-file#lisa), [Flash Attention](https://github.com/OptimalScale/LMFlow/blob/main/readme/flash_attn2.md), and other acceleration techniques.
180
+ For more details, please refer to the [LMFlow for Hymba](https://github.com/OptimalScale/LMFlow/tree/main/experimental/Hymba) documentation.
181
+
182
  ## Limitations
183
  The model was trained on data that contains toxic language, unsafe content, and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
184