File size: 3,853 Bytes
0d379c3
 
cb67304
05b42d0
 
 
 
 
0d379c3
cb67304
05b42d0
e17e276
4d92f2c
05b42d0
 
 
 
4d92f2c
05b42d0
 
0d379c3
e17e276
 
05b42d0
 
4d92f2c
 
 
 
 
e17e276
 
4d92f2c
 
 
 
 
 
 
e17e276
4d92f2c
 
 
e17e276
 
 
 
 
05b42d0
 
 
4d92f2c
 
05b42d0
 
 
 
 
e17e276
05b42d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e17e276
 
05b42d0
e17e276
 
 
 
 
 
05b42d0
4d92f2c
 
 
 
 
e17e276
 
 
 
 
 
 
 
 
 
 
 
4d92f2c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
library_name: peft
base_model: mistralai/Mistral-7B-Instruct-v0.2
language:
- en
pipeline_tag: text-generation
tags:
- education
---
# Base Model: mistralai/Mistral-7B-Instruct-v0_2_student_answer_train_examples_mistral_0416
  * LoRAs weights for Mistral-7b-Instruct-v0_2


# Noteworthy changes: 
  * reduced training hyperparams: epochs=3 (previously 4)
  * new training prompt: "Teenager students write in simple sentences.
          You are a teenager student, and please answer the following question. {training example}"

  * old training prompt: "Teenager students write in simple sentences [with typos and grammar errors].
          You are a teenager student, and please answer the following question. {training example}"


## Model Details
Fine-tuned model that talks like middle school students, using simple vocabulary and grammar. 
  * Trained on student Q&As physics topics including pulley/ramp examples that discuss work, force, and etc.

### Model Description

<!-- Provide a longer summary of what this model is. -->



- **Developed by:** [More Information Needed]
- **Funded by [optional]:** [More Information Needed]
- **Shared by [optional]:** [More Information Needed]
- **Model type:** [More Information Needed]
- **Language(s) (NLP):** [More Information Needed]
- **License:** [More Information Needed]
- **Finetuned from model [optional]:** [More Information Needed]

### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]

## Model Details
Fine-tuned model to talk like middle school students, using typos/grammar errors. 
Trained on student Q&As physics topics including pulley/ramp examples that discuss work, force, and etc.


- **Developed by:** Nora T
- **Finetuned from model:** mistralai_Mistral-7B-Instruct-v0.2
- **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]

## How to Get Started:
1. Load Mistral model first:
```
from peft import PeftModel # for fine-tuning
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, GenerationConfig, GPTQConfig, BitsAndBytesConfig

model_name_or_path = "mistralai/Mistral-7B-Instruct-v0.2"
nf4_config = BitsAndBytesConfig( # quantization 4-bit
   load_in_4bit=True,
   bnb_4bit_quant_type="nf4",
   bnb_4bit_use_double_quant=True,
   bnb_4bit_compute_dtype=torch.bfloat16
)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
                                             device_map="auto",
                                             trust_remote_code=False,
                                             quantization_config=nf4_config,
                                             revision="main")

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
```

2. Load in LoRA weights:
```
lora_model_path = "{path_to_loras_folder}/mistralai_Mistral-7B-Instruct-v0.2-testgen-LoRAs" # load loras
model = PeftModel.from_pretrained(
        model, lora_model_path, torch_dtype=torch.float16, force_download=True,
      )

```

## Training Hyperparams
  * LoRA Rank: 128
  * LoRA Alpha: 32
  * Batch Size: 64
  * Cutoff Length: 256
  * Learning rate: 3e-4 
  * Epochs: 3
  * LoRA Dropout: 0.05

### Training Data
Trained on raw text file 

#### Preprocessing [optional]

[More Information Needed]


## Technical Specifications 

### Model Architecture and Objective

[More Information Needed]

#### Hardware

[More Information Needed]

#### Software

[More Information Needed]

## Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

### Framework versions

- PEFT 0.7.1