niksyromyatnikov commited on
Commit
e3db7d8
·
verified ·
1 Parent(s): 6dfd114

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +63 -113
README.md CHANGED
@@ -4,12 +4,15 @@ library_name: peft
4
  license: cc-by-nc-4.0
5
  language:
6
  - uk
 
7
  ---
8
 
9
  # Model Card for Model ID
10
 
11
  <!-- Provide a quick summary of what the model is/does. -->
12
 
 
 
13
  Presented in [Empowering Smaller Models: Tuning LLaMA and Gemma with Chain-of-Thought for Ukrainian Exam Tasks (arXiv:2503.13988)](https://arxiv.org/abs/2503.13988)
14
 
15
  PEFT 4bit tuning of meta-llama/Llama-3.1-8B-Instruct on Ukrainian language and literature tasks of ZNO (EIE) & NMT dataset to generate step-by-step solution with task topic:
@@ -46,194 +49,141 @@ Today Date: 26 Jul 2024
46
  ```
47
 
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ## Model Details
50
 
51
  ### Model Description
52
 
53
  <!-- Provide a longer summary of what this model is. -->
54
 
55
-
56
-
57
- - **Developed by:** [More Information Needed]
58
- - **Funded by [optional]:** [More Information Needed]
59
- - **Shared by [optional]:** [More Information Needed]
60
- - **Model type:** [More Information Needed]
61
- - **Language(s) (NLP):** [More Information Needed]
62
- - **License:** [More Information Needed]
63
- - **Finetuned from model [optional]:** [More Information Needed]
64
 
65
  ### Model Sources [optional]
66
 
67
  <!-- Provide the basic links for the model. -->
68
 
69
- - **Repository:** [More Information Needed]
70
- - **Paper [optional]:** [More Information Needed]
71
- - **Demo [optional]:** [More Information Needed]
72
 
73
  ## Uses
74
 
75
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
76
-
77
  ### Direct Use
78
 
79
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
80
 
81
- [More Information Needed]
82
-
83
- ### Downstream Use [optional]
84
 
85
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
86
-
87
- [More Information Needed]
88
 
89
  ### Out-of-Scope Use
90
 
91
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
92
-
93
- [More Information Needed]
94
 
95
  ## Bias, Risks, and Limitations
96
 
97
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
98
-
99
- [More Information Needed]
100
 
101
  ### Recommendations
102
 
103
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
104
-
105
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
106
-
107
- ## How to Get Started with the Model
108
-
109
- Use the code below to get started with the model.
110
-
111
- [More Information Needed]
112
 
113
  ## Training Details
114
 
115
  ### Training Data
116
 
117
- <!-- 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. -->
118
-
119
- [More Information Needed]
120
 
121
  ### Training Procedure
122
 
123
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
124
-
125
- #### Preprocessing [optional]
126
-
127
  [More Information Needed]
128
 
129
-
130
  #### Training Hyperparameters
131
 
132
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
133
 
134
- #### Speeds, Sizes, Times [optional]
135
-
136
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
137
 
138
  [More Information Needed]
139
 
140
  ## Evaluation
141
 
142
- <!-- This section describes the evaluation protocols and provides the results. -->
143
-
144
  ### Testing Data, Factors & Metrics
145
 
146
  #### Testing Data
147
 
148
- <!-- This should link to a Dataset Card if possible. -->
149
-
150
- [More Information Needed]
151
 
152
  #### Factors
153
 
154
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
155
-
156
  [More Information Needed]
157
 
158
  #### Metrics
159
 
160
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
161
-
162
  [More Information Needed]
163
 
164
  ### Results
165
 
166
- [More Information Needed]
167
-
168
  #### Summary
169
 
170
-
171
-
172
- ## Model Examination [optional]
173
-
174
- <!-- Relevant interpretability work for the model goes here -->
175
-
176
- [More Information Needed]
177
-
178
- ## Environmental Impact
179
-
180
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
181
-
182
- 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).
183
-
184
- - **Hardware Type:** [More Information Needed]
185
- - **Hours used:** [More Information Needed]
186
- - **Cloud Provider:** [More Information Needed]
187
- - **Compute Region:** [More Information Needed]
188
- - **Carbon Emitted:** [More Information Needed]
189
-
190
- ## Technical Specifications [optional]
191
-
192
- ### Model Architecture and Objective
193
-
194
- [More Information Needed]
195
-
196
- ### Compute Infrastructure
197
-
198
- [More Information Needed]
199
-
200
- #### Hardware
201
-
202
  [More Information Needed]
203
 
204
- #### Software
205
-
206
- [More Information Needed]
207
-
208
- ## Citation [optional]
209
-
210
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
211
 
212
  **BibTeX:**
213
 
214
- [More Information Needed]
 
 
 
 
 
 
 
215
 
216
  **APA:**
217
 
218
  [More Information Needed]
219
 
220
- ## Glossary [optional]
221
-
222
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
223
-
224
- [More Information Needed]
225
-
226
- ## More Information [optional]
227
-
228
- [More Information Needed]
229
-
230
- ## Model Card Authors [optional]
231
-
232
- [More Information Needed]
233
-
234
  ## Model Card Contact
235
 
236
  [More Information Needed]
 
237
  ### Framework versions
238
 
239
  - PEFT 0.14.0
 
4
  license: cc-by-nc-4.0
5
  language:
6
  - uk
7
+ pipeline_tag: text-generation
8
  ---
9
 
10
  # Model Card for Model ID
11
 
12
  <!-- Provide a quick summary of what the model is/does. -->
13
 
14
+ **This model is CC BY NC 4.0 (allowing only non-commercial use) and should not be used outside of research purposes.**
15
+
16
  Presented in [Empowering Smaller Models: Tuning LLaMA and Gemma with Chain-of-Thought for Ukrainian Exam Tasks (arXiv:2503.13988)](https://arxiv.org/abs/2503.13988)
17
 
18
  PEFT 4bit tuning of meta-llama/Llama-3.1-8B-Instruct on Ukrainian language and literature tasks of ZNO (EIE) & NMT dataset to generate step-by-step solution with task topic:
 
49
  ```
50
 
51
 
52
+ ## Inference code
53
+
54
+ ```
55
+ import torch
56
+ from peft import PeftModel
57
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
58
+
59
+ quantization_config = BitsAndBytesConfig(
60
+ load_in_4bit=True,
61
+ bnb_4bit_compute_dtype=torch.float16, # computation in fp16
62
+ bnb_4bit_use_double_quant=True, # enables double quantization for better accuracy
63
+ bnb_4bit_quant_type="nf4" # choose "nf4" (normal float4) or other types as supported
64
+ )
65
+
66
+ base_model = "unsloth/Llama-3.1-8B-Instruct"
67
+
68
+ tokenizer = AutoTokenizer.from_pretrained(base_model, max_sequence_length=3072, model_max_length=3072)
69
+ model_base = AutoModelForCausalLM.from_pretrained(base_model, quantization_config=quantization_config, device_map="auto", torch_dtype=torch.float16, use_flash_attention_2=False)
70
+ model = PeftModel.from_pretrained(model_base, "NLPForUA/Llama-3.1-8B-Instruct-zno-cot-with-topic", quantization_config=quantization_config, device_map="auto", torch_dtype=torch.float16, use_flash_attention_2=False)
71
+
72
+ print(tokenizer.decode(
73
+ model.generate(
74
+ input_ids=inputs,
75
+ max_new_tokens=1024,
76
+ use_cache=True,
77
+ temperature=0.0,
78
+ do_sample=False,
79
+ repetition_penalty=1.0,
80
+ pad_token_id=tokenizer.eos_token_id
81
+ )[0]))
82
+ ```
83
+
84
+
85
  ## Model Details
86
 
87
  ### Model Description
88
 
89
  <!-- Provide a longer summary of what this model is. -->
90
 
91
+ - **Developed by:** NLP for UA
92
+ - **Model type:** LLaMA
93
+ - **Language(s) (NLP):** Ukrainian (uk)
94
+ - **License:** cc-by-nc-4.0
95
+ - **Finetuned from model:** unsloth/Llama-3.1-8B-Instruct
 
 
 
 
96
 
97
  ### Model Sources [optional]
98
 
99
  <!-- Provide the basic links for the model. -->
100
 
101
+ - **Repository:** [github.com/NLPForUA/ZNO](https://github.com/NLPForUA/ZNO)
102
+ - **Paper:** [Empowering Smaller Models: Tuning LLaMA and Gemma with Chain-of-Thought for Ukrainian Exam Tasks (arXiv:2503.13988)](https://arxiv.org/abs/2503.13988)
 
103
 
104
  ## Uses
105
 
 
 
106
  ### Direct Use
107
 
108
+ The model can be used directly for generating step-by-step solutions to Ukrainian language and literature exam tasks. Input should follow the format shown in the example above.
109
 
110
+ ### Downstream Use
 
 
111
 
112
+ The model could be fine-tuned further for other Ukrainian language tasks or integrated into educational applications.
 
 
113
 
114
  ### Out-of-Scope Use
115
 
116
+ This model is specifically trained for Ukrainian exam tasks. It may not perform well on other languages or tasks.
 
 
117
 
118
  ## Bias, Risks, and Limitations
119
 
120
+ The model may exhibit biases present in the training data. It is crucial to critically evaluate its outputs and be aware of potential inaccuracies. Further analysis is needed to fully characterize biases and limitations.
 
 
121
 
122
  ### Recommendations
123
 
124
+ Users should be aware of the potential biases and limitations of the model and use its output critically. Further evaluation is needed to fully assess the model's capabilities and limitations.
 
 
 
 
 
 
 
 
125
 
126
  ## Training Details
127
 
128
  ### Training Data
129
 
130
+ [More Information Needed - Link to Dataset Card and description]
 
 
131
 
132
  ### Training Procedure
133
 
 
 
 
 
134
  [More Information Needed]
135
 
 
136
  #### Training Hyperparameters
137
 
138
+ - **Training regime:** 4-bit quantization
139
 
140
+ #### Speeds, Sizes, Times
 
 
141
 
142
  [More Information Needed]
143
 
144
  ## Evaluation
145
 
 
 
146
  ### Testing Data, Factors & Metrics
147
 
148
  #### Testing Data
149
 
150
+ [More Information Needed - Link to Dataset Card and description]
 
 
151
 
152
  #### Factors
153
 
 
 
154
  [More Information Needed]
155
 
156
  #### Metrics
157
 
 
 
158
  [More Information Needed]
159
 
160
  ### Results
161
 
 
 
162
  #### Summary
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  [More Information Needed]
165
 
166
+ ## Citation
 
 
 
 
 
 
167
 
168
  **BibTeX:**
169
 
170
+ ```bibtex
171
+ @article{EmpoweringSmallerModels,
172
+ author = {Mykyta Syromiatnikov, Victoria Ruvinskaya, and Nataliia Komleva},
173
+ title = {Empowering Smaller Models: Tuning LLaMA and Gemma with Chain-of-Thought for Ukrainian Exam Tasks},
174
+ journal = {arXiv preprint arXiv:2503.13988},
175
+ year = {2025}
176
+ }
177
+ ```
178
 
179
  **APA:**
180
 
181
  [More Information Needed]
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  ## Model Card Contact
184
 
185
  [More Information Needed]
186
+
187
  ### Framework versions
188
 
189
  - PEFT 0.14.0