Update README.md
Browse files
README.md
CHANGED
@@ -6,10 +6,48 @@ language:
|
|
6 |
- en
|
7 |
pipeline_tag: text-generation
|
8 |
---
|
9 |
-
#
|
|
|
10 |
## Mistral 7B fine-tuned on LIMA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
WIP
|
13 |
|
14 |
### Usage
|
15 |
```py
|
@@ -29,4 +67,11 @@ gen = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
|
|
29 |
instruction = "[INST] Write a email to day goodbye to me boss [\INST]"
|
30 |
res = gen(instruction, max_new_tokens=512, temperature=0.3, top_p=0.75, top_k=40, repetition_penalty=1.2)
|
31 |
print(res[0]['generated_text'])
|
32 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- en
|
7 |
pipeline_tag: text-generation
|
8 |
---
|
9 |
+
# LIMSTAL
|
10 |
+
|
11 |
## Mistral 7B fine-tuned on LIMA
|
12 |
+
This model is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the LIMA dataset.
|
13 |
+
|
14 |
+
## Training procedure
|
15 |
+
|
16 |
+
The model was loaded on **8 bits** and fine-tuned on the LIMA dataset using the **LoRA** PEFT technique with the `huggingface/peft` library for 2 epochs on 1 x A100 (40GB) GPU.
|
17 |
+
LoRA config:
|
18 |
+
```
|
19 |
+
config = LoraConfig(
|
20 |
+
lora_alpha=16,
|
21 |
+
lora_dropout=0.1,
|
22 |
+
r=64,
|
23 |
+
bias="none",
|
24 |
+
task_type="CAUSAL_LM",
|
25 |
+
target_modules = ['q_proj', 'k_proj', 'down_proj', 'v_proj', 'o_proj', 'gate_proj', 'up_proj']
|
26 |
+
)
|
27 |
+
```
|
28 |
+
|
29 |
+
### Training hyperparameters
|
30 |
+
|
31 |
+
The following hyperparameters were used during training:
|
32 |
+
- learning_rate: 0.0002
|
33 |
+
- train_batch_size: 2
|
34 |
+
- eval_batch_size: 8
|
35 |
+
- seed: 66
|
36 |
+
- gradient_accumulation_steps: 64
|
37 |
+
- total_train_batch_size: 128
|
38 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
39 |
+
- lr_scheduler_type: constant
|
40 |
+
- lr_scheduler_warmup_ratio: 0.03
|
41 |
+
- num_epochs: 2
|
42 |
+
- mixed_precision_training: Native AMP
|
43 |
+
|
44 |
+
### Training results
|
45 |
+
|
46 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
47 |
+
|:-------------:|:-----:|:----:|:---------------:|
|
48 |
+
| 1.7917 | 0.72 | 5 | 1.7604 |
|
49 |
+
| 1.7743 | 1.44 | 10 | 1.7217 |
|
50 |
|
|
|
51 |
|
52 |
### Usage
|
53 |
```py
|
|
|
67 |
instruction = "[INST] Write a email to day goodbye to me boss [\INST]"
|
68 |
res = gen(instruction, max_new_tokens=512, temperature=0.3, top_p=0.75, top_k=40, repetition_penalty=1.2)
|
69 |
print(res[0]['generated_text'])
|
70 |
+
```
|
71 |
+
|
72 |
+
### Framework versions
|
73 |
+
|
74 |
+
- Transformers 4.35.0.dev0
|
75 |
+
- Pytorch 2.1.0+cu118
|
76 |
+
- Datasets 2.14.6
|
77 |
+
- Tokenizers 0.14.1
|