benhaotang commited on
Commit
d5969b3
·
verified ·
1 Parent(s): 9820790

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +92 -198
README.md CHANGED
@@ -1,202 +1,96 @@
1
  ---
2
- base_model: unsloth/mistral-small-instruct-2409-bnb-4bit
 
3
  library_name: peft
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
-
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
200
- ### Framework versions
201
-
202
- - PEFT 0.13.2
 
1
  ---
2
+ base_model:
3
+ - mistralai/Mistral-Small-Instruct-2409
4
  library_name: peft
5
+ datasets:
6
+ - kejian/arxiv-physics-debug-v0
7
  ---
8
 
9
+ # Mistral Physics Fine-tuned Model
10
+
11
+ This model is a fine-tuned version of [mistralai/Mistral-Small-Instruct-2409](https://huggingface.co/mistralai/Mistral-Small-Instruct-2409) on [kejian/arxiv-physics-debug-v0](https://huggingface.co/datasets/kejian/arxiv-physics-debug-v0). Mostly for concept proofing, don't trust it for real physics (I mean, even Claude 3.5 can be wrong on graduate physics plenty of times, let alone a 22B model, but this hould perform a lot better than [benhaotang/llama3.2-1B-physics-finetuned](https://huggingface.co/benhaotang/llama3.2-1B-physics-finetuned))!
12
+
13
+ Sorry for not having F16 version, there is no way to fit everything into VRAM or RAM at the same time in my current configuration.
14
+
15
+ ## Model description
16
+ - Base model: [mistralai/Mistral-Small-Instruct-2409](https://huggingface.co/mistralai/Mistral-Small-Instruct-2409)
17
+ - Training data: [kejian/arxiv-physics-debug-v0](https://huggingface.co/datasets/kejian/arxiv-physics-debug-v0)
18
+ - Fine-tuning type: LoRA
19
+ - Use case: Physics domain questions
20
+ - Training Arguments:
21
+ - Learning Rate: 2e-5
22
+ - Epochs: 3
23
+ - Gradient Accumulation Steps: 8
24
+ - Training setup: Colab with Nvidia L4
25
+
26
+ ## Usage
27
+ ```python
28
+ from transformers import AutoModelForCausalLM, BitsAndBytesConfig
29
+ import torch
30
+ bnb_config = BitsAndBytesConfig(
31
+ load_in_8bit=False,
32
+ llm_int8_enable_fp32_cpu_offload=True
33
+ )
34
+ model = AutoModelForCausalLM.from_pretrained(
35
+ "benhaotang/mistral-small-physics-finetuned-bnb-4bit",
36
+ device_map="auto",
37
+ torch_dtype=torch.float16,
38
+ offload_folder="offload_folder",
39
+ quantization_config=bnb_config
40
+ )
41
+ tokenizer = AutoTokenizer.from_pretrained("benhaotang/mistral-small-physics-finetuned-bnb-4bit")
42
+
43
+ # Example usage
44
+ text = "Give me a short intodcution to renormalization group(RG) flow in physcis?\n"
45
+ inputs = tokenizer(text, return_tensors="pt").to("cuda")
46
+ outputs = model.generate(**inputs, max_length=2048)
47
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
48
+ ```
49
+
50
+ Example output:
51
+
52
+ > The Renormalization Group (RG) flow is a fundamental concept in physics, particularly in the study of phase transitions and critical phenomena. It describes how the behavior of a system changes with scale, such as the size of the system or the length scale of fluctuations. Here's a brief introduction:
53
+ >
54
+ > 1. **Scale Dependence**: Many physical systems exhibit properties that depend on the scale at which they are observed. For example, a fluid might appear smooth on a large scale but exhibit turbulent behavior on a small scale.
55
+ >
56
+ > 2. **RG Transformation**: The RG flow involves a transformation that systematically integrates out short-distance fluctuations to obtain an effective theory that describes the system at longer distances. This is often done by progressively eliminating high-momentum modes in the system.
57
+ >
58
+ > 3. **Fixed Points and Universality**: The RG flow can lead to fixed points, which are scale-invariant solutions. Systems that flow to the same fixed point under RG transformation exhibit universal behavior, meaning their large-scale properties are the same regardless of the details of the system at small scales.
59
+ >
60
+ > 4. **Relevant and Irrelevant Operators**: In the vicinity of a fixed point, operators can be classified as relevant (grow under RG flow), irrelevant (shrink), or marginal (remain constant). Relevant operators drive the system away from the fixed point, while irrelevant ones become negligible at large scales.
61
+ >
62
+ > 5. **Applications**: RG flow is crucial in understanding critical phenomena, such as phase transitions in statistical mechanics, and has applications in condensed matter physics, quantum field theory, and even in areas like biology and computer science.
63
+ >
64
+ > In essence, RG flow helps us understand how the microscopic details of a system influence its macroscopic behavior, and how universal properties emerge from complex systems.
65
+
66
+ ### Training
67
+
68
+ | Step | Training Loss | Validation Loss |
69
+ |:----:|:-------------:|:---------------:|
70
+ | 50 | 2.407400 | 1.798349 |
71
+ | 100 | 1.452000 | 1.765856 |
72
+ | 150 | 1.161300 | 1.716366 |
73
+ | 200 | 1.223700 | 1.704631 |
74
+ | 250 | 1.135900 | 1.683653 |
75
+ | 300 | 1.371900 | 1.677721 |
76
+ | 350 | 1.208500 | 1.657915 |
77
+ | 400 | 1.303400 | 1.657678 |
78
+ | 450 | 1.233700 | 1.642972 |
79
+ | 500 | 1.081900 | 1.653393 |
80
+ | 550 | 1.117700 | 1.645338 |
81
+ | 600 | 1.109500 | 1.651868 |
82
+ | 650 | 1.190100 | 1.689853 |
83
+ | 700 | 1.000000 | 1.663633 |
84
+ | 750 | 1.020100 | 1.647308 |
85
+ | 800 | 1.033400 | 1.675173 |
86
+ | 850 | 1.082300 | 1.652737 |
87
+ | 900 | 1.074000 | 1.665859 |
88
+ | 950 | 0.975300 | 1.661394 |
89
+ | 1000 | 0.955000 | 1.672116 |
90
+ | 1050 | 1.017000 | 1.656730 |
91
+ | 1100 | 0.941500 | 1.652197 |
92
+ | 1150 | 1.003100 | 1.657381 |
93
+ | 1200 | 0.891100 | 1.662021 |
94
+ | 1250 | 0.931000 | 1.662401 |
95
+ | 1300 | 0.932800 | 1.662421 |
96
+ | 1350 | 1.042000 | 1.665535 |