khoicrtp commited on
Commit
947b9bd
1 Parent(s): 69bd1f6
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. LICENSE +201 -0
  2. README.md +137 -0
  3. dolly-lora-3b/adapter_config.json +17 -0
  4. dolly-lora-3b/adapter_model.bin +3 -0
  5. dolly-lora-3b/checkpoint-74/adapter_model/adapter_config.json +17 -0
  6. dolly-lora-3b/checkpoint-74/adapter_model/adapter_model.bin +3 -0
  7. dolly-lora-3b/completed +0 -0
  8. dolly-lora-3b/runs/May31_16-47-55_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685551678.7273395/events.out.tfevents.1685551678.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.842.1 +3 -0
  9. dolly-lora-3b/runs/May31_16-47-55_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685551678.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.842.0 +3 -0
  10. dolly-lora-3b/runs/May31_16-49-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685551774.861798/events.out.tfevents.1685551774.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.1346.1 +3 -0
  11. dolly-lora-3b/runs/May31_16-49-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685551774.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.1346.0 +3 -0
  12. dolly-lora-3b/runs/May31_17-01-39_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552502.9188092/events.out.tfevents.1685552502.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4093.1 +3 -0
  13. dolly-lora-3b/runs/May31_17-01-39_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552502.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4093.0 +3 -0
  14. dolly-lora-3b/runs/May31_17-05-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552767.5582433/events.out.tfevents.1685552767.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4863.1 +3 -0
  15. dolly-lora-3b/runs/May31_17-05-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552767.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4863.0 +3 -0
  16. dolly-lora-3b/runs/May31_17-07-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552881.8848104/events.out.tfevents.1685552881.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.5285.1 +3 -0
  17. dolly-lora-3b/runs/May31_17-07-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552881.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.5285.0 +3 -0
  18. dolly-lora-3b/runs/May31_17-28-48_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554131.1705441/events.out.tfevents.1685554131.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.8874.1 +3 -0
  19. dolly-lora-3b/runs/May31_17-28-48_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554131.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.8874.0 +3 -0
  20. dolly-lora-3b/runs/May31_17-30-04_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554207.7913668/events.out.tfevents.1685554207.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9110.1 +3 -0
  21. dolly-lora-3b/runs/May31_17-30-04_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554207.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9110.0 +3 -0
  22. dolly-lora-3b/runs/May31_17-34-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554474.8726966/events.out.tfevents.1685554474.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9915.1 +3 -0
  23. dolly-lora-3b/runs/May31_17-34-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554474.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9915.0 +3 -0
  24. dolly-lora-3b/runs/May31_17-42-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554982.2030103/events.out.tfevents.1685554982.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11407.1 +3 -0
  25. dolly-lora-3b/runs/May31_17-42-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554982.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11407.0 +3 -0
  26. dolly-lora-3b/runs/May31_17-44-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685555101.7508595/events.out.tfevents.1685555101.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11777.1 +3 -0
  27. dolly-lora-3b/runs/May31_17-44-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685555101.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11777.0 +3 -0
  28. dolly-lora-3b/runs/May31_17-50-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685555433.7950974/events.out.tfevents.1685555433.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.12764.1 +3 -0
  29. dolly-lora-3b/runs/May31_17-50-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685555433.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.12764.0 +3 -0
  30. finetune.py +356 -0
  31. generate.py +222 -0
  32. requirements.txt +11 -0
  33. templates/README.md +46 -0
  34. templates/alpaca.json +6 -0
  35. templates/alpaca_legacy.json +6 -0
  36. templates/alpaca_short.json +6 -0
  37. templates/vigogne.json +6 -0
  38. utils/README.md +13 -0
  39. utils/__init__.py +0 -0
  40. utils/__pycache__/__init__.cpython-39.pyc +0 -0
  41. utils/__pycache__/prompter.cpython-39.pyc +0 -0
  42. utils/callbacks.py +75 -0
  43. utils/prompter.py +51 -0
  44. wandb/debug-cli.root.log +0 -0
  45. wandb/debug-internal.log +1 -0
  46. wandb/debug.log +1 -0
  47. wandb/latest-run +1 -0
  48. wandb/run-20230531_164935-4dg4abji/files/conda-environment.yaml +497 -0
  49. wandb/run-20230531_164935-4dg4abji/files/config.yaml +588 -0
  50. wandb/run-20230531_164935-4dg4abji/files/output.log +2 -0
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LLM Fine-Tuning with QLoRA
2
+
3
+ This repository can help to instruct-tune Open LLaMA, RedPajama or StableLM models on consumer hardware using QLoRA (Original implementation [here](https://github.com/artidoro/qlora)). It's mostly based on the original alpaca-lora repo which can be found [here](https://github.com/tloen/alpaca-lora). Please note that this has only been tested on Open LLama 3b and RedPajama 3b Models, but should work with other models. Contributions are welcome!
4
+
5
+ ### Local Setup
6
+
7
+ 1. Install dependencies
8
+
9
+ ```bash
10
+ pip install -r requirements.txt
11
+ ```
12
+
13
+ 1. If bitsandbytes doesn't work, [install it from source.](https://github.com/TimDettmers/bitsandbytes/blob/main/compile_from_source.md) Windows users can follow [these instructions](https://github.com/tloen/alpaca-lora/issues/17).
14
+
15
+ ## Training (finetune.py)
16
+
17
+ This file contains a straightforward application of QLoRA PEFT to the Open LLaMA / RedPajama / StableLM model, as well as some code related to prompt construction and tokenization. PRs adapting this code to support larger models are always welcome.
18
+
19
+ **Example usage:**
20
+
21
+ For Open LLaMa
22
+
23
+ python finetune.py \
24
+ --base_model 'openlm-research/open_llama_3b_600bt_preview' \
25
+ --data_path '../datasets/dolly.json' \
26
+ --num_epochs=3 \
27
+ --cutoff_len=512 \
28
+ --group_by_length \
29
+ --output_dir='./dolly-lora-3b' \
30
+ --lora_r=16 \
31
+ --lora_target_modules='[q_proj,v_proj]'
32
+
33
+ For RedPajama
34
+
35
+ python finetune.py \
36
+ --base_model='togethercomputer/RedPajama-INCITE-Base-3B-v1' \
37
+ --data_path='../datasets/dolly.json' \
38
+ --num_epochs=3 \
39
+ --cutoff_len=512 \
40
+ --group_by_length \
41
+ --output_dir='./dolly-lora-rp-3b-t1' \
42
+ --lora_r=16 \
43
+ --lora_target_modules='["query_key_value"]'
44
+
45
+ For StableLM
46
+
47
+ python finetune.py \
48
+ --base_model='stabilityai/stablelm-base-alpha-3b' \
49
+ --data_path='../datasets/dolly.json' \
50
+ --num_epochs=3 \
51
+ --cutoff_len=512 \
52
+ --group_by_length \
53
+ --output_dir='./dolly-lora-st-3b-t1' \
54
+ --lora_r=16 \
55
+ --lora_target_modules='["query_key_value"]'
56
+
57
+ For Pythia
58
+
59
+ python finetune.py \
60
+ --base_model='EleutherAI/pythia-6.9b-deduped' \
61
+ --data_path='../datasets/dolly.json' \
62
+ --num_epochs=1 \
63
+ --cutoff_len=512 \
64
+ --group_by_length \
65
+ --output_dir='./dolly-lora-pyt-6b-t1' \
66
+ --lora_r=8 \
67
+ --lora_target_modules='["query_key_value"]'
68
+
69
+ We can also tweak our hyperparameters (similar to alpaca-lora):
70
+
71
+ python finetune.py \
72
+ --base_model 'openlm-research/open_llama_3b_600bt_preview \
73
+ --data_path 'yahma/alpaca-cleaned' \
74
+ --output_dir './lora-alpaca' \
75
+ --batch_size 128 \
76
+ --micro_batch_size 4 \
77
+ --num_epochs 3 \
78
+ --learning_rate 1e-4 \
79
+ --cutoff_len 512 \
80
+ --val_set_size 2000 \
81
+ --lora_r 8 \
82
+ --lora_alpha 16 \
83
+ --lora_dropout 0.05 \
84
+ --lora_target_modules '[q_proj,v_proj]' \
85
+ --train_on_inputs \
86
+ --group_by_length
87
+
88
+ ## Inference (generate.py)
89
+ This file reads the foundation model from the Hugging Face model hub and the LoRA weights from trained peft model, and runs a Gradio interface for inference on a specified input. Users should treat this as example code for the use of the model, and modify it as needed.
90
+
91
+ Example usage:
92
+
93
+ For Open LLaMa
94
+
95
+ python generate.py \
96
+ --base_model 'openlm-research/open_llama_3b_600bt_preview' \
97
+ --lora_weights './lora-alpaca'
98
+
99
+ For RedPajama
100
+
101
+ python generate.py \
102
+ --base_model 'togethercomputer/RedPajama-INCITE-Base-3B-v1' \
103
+ --lora_weights './dolly-lora-rp-3b-t1/'
104
+
105
+ For StableLM
106
+
107
+ python generate.py \
108
+ --base_model 'stabilityai/stablelm-base-alpha-3b' \
109
+ --lora_weights './dolly-lora-st-3b-t1'
110
+
111
+ For Pythia
112
+
113
+ python generate.py \
114
+ --base_model 'EleutherAI/pythia-6.9b-deduped' \
115
+ --lora_weights './dolly-lora-pyt-6b-t1'
116
+
117
+ # Acknowledgements
118
+
119
+ We would like to express our heartfelt gratitude to **Meta** for releasing LLaMA . Without this pioneering technology, the foundations of projects like **Open Llama** and **Alpaca** wouldn't exist. We sincerely appreciate the immense contributions you've made to the field.
120
+
121
+ Our acknowledgements also extend to the teams behind **Open LLaMA**, **Together Computer**, **Alpaca** and **Alpaca LoRA**.. You can find more about their excellent work on their respective GitHub repositories:
122
+
123
+ - [Open Llama](https://github.com/openlm-research/open_llama)
124
+ - [Together Computer](https://github.com/togethercomputer)
125
+ - [Alpaca](https://github.com/tatsu-lab/stanford_alpaca)
126
+ - [Alpaca LoRa](https://github.com/tloen/alpaca-lora)
127
+
128
+ Lastly, we would like to express our thanks to the developers of **QLoRA** and **bitsandbytes** Your efforts have been instrumental in advancing the field, and we're grateful for your contributions. More information about these projects can be found at:
129
+
130
+ - [QLoRA](https://github.com/artidoro/qlora)
131
+ - [bitsandbytes](https://github.com/TimDettmers/bitsandbytes)
132
+
133
+
134
+ Thank you all for your commitment to innovation and for making these projects possible.
135
+
136
+
137
+
dolly-lora-3b/adapter_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model_name_or_path": "openlm-research/open_llama_3b_600bt_preview",
3
+ "bias": "none",
4
+ "fan_in_fan_out": false,
5
+ "inference_mode": true,
6
+ "init_lora_weights": true,
7
+ "lora_alpha": 16,
8
+ "lora_dropout": 0.05,
9
+ "modules_to_save": null,
10
+ "peft_type": "LORA",
11
+ "r": 8,
12
+ "target_modules": [
13
+ "q_proj",
14
+ "v_proj"
15
+ ],
16
+ "task_type": "CAUSAL_LM"
17
+ }
dolly-lora-3b/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9994386523dd08dcb905bb833e23ad228fe9b7eb1928feac87ae57d69aab77ff
3
+ size 10686701
dolly-lora-3b/checkpoint-74/adapter_model/adapter_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model_name_or_path": "openlm-research/open_llama_3b_600bt_preview",
3
+ "bias": "none",
4
+ "fan_in_fan_out": false,
5
+ "inference_mode": true,
6
+ "init_lora_weights": true,
7
+ "lora_alpha": 16,
8
+ "lora_dropout": 0.05,
9
+ "modules_to_save": null,
10
+ "peft_type": "LORA",
11
+ "r": 8,
12
+ "target_modules": [
13
+ "q_proj",
14
+ "v_proj"
15
+ ],
16
+ "task_type": "CAUSAL_LM"
17
+ }
dolly-lora-3b/checkpoint-74/adapter_model/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9994386523dd08dcb905bb833e23ad228fe9b7eb1928feac87ae57d69aab77ff
3
+ size 10686701
dolly-lora-3b/completed ADDED
File without changes
dolly-lora-3b/runs/May31_16-47-55_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685551678.7273395/events.out.tfevents.1685551678.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.842.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ce07c5d7cc092e0a36e2c5d44616fb69a854cabd11561af584ae0500ce442f6
3
+ size 5930
dolly-lora-3b/runs/May31_16-47-55_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685551678.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.842.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23ac1851b68a07d0db801189c0484a26eeb84d3ca84b90a1c7a7c7769d2c9a93
3
+ size 4310
dolly-lora-3b/runs/May31_16-49-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685551774.861798/events.out.tfevents.1685551774.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.1346.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb3648af42d320570d71de09f1921cb16b2db885201453e7a77029cac7bfbfed
3
+ size 5930
dolly-lora-3b/runs/May31_16-49-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685551774.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.1346.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f5054d72271b3ecf30eb0127f0b23ab358bec6706a4850d13ab3950e8b8072c
3
+ size 4310
dolly-lora-3b/runs/May31_17-01-39_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552502.9188092/events.out.tfevents.1685552502.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4093.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a300b9acf63d3b4ba225c8ec9770ab7c5687f6e3dbc32023c0f123fc91058427
3
+ size 5930
dolly-lora-3b/runs/May31_17-01-39_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552502.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4093.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e43353ef5af59f4aecbe429a1193e88ac04bdb3a1bee620add229fb3bb268a5
3
+ size 4309
dolly-lora-3b/runs/May31_17-05-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552767.5582433/events.out.tfevents.1685552767.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4863.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc67c328c4d8e75c4f585664f4243601e314aefe3b3e30e2d4910cd33e13c6e6
3
+ size 5930
dolly-lora-3b/runs/May31_17-05-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552767.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.4863.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d8a39054689c9b92f3b37bb995ac54975f36501510a9baa3d54e80c948e7c7f
3
+ size 4309
dolly-lora-3b/runs/May31_17-07-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685552881.8848104/events.out.tfevents.1685552881.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.5285.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08cdf6a8a8ab9ae4153b83c7279686902be559beb5d1579c77dba4b1e73c3a24
3
+ size 5930
dolly-lora-3b/runs/May31_17-07-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685552881.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.5285.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0114b1fea3d4397c9a1927040d970ddf3663faa5190c8df4fb1d585b3d49990
3
+ size 4309
dolly-lora-3b/runs/May31_17-28-48_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554131.1705441/events.out.tfevents.1685554131.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.8874.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a384809fc162bf124c334745be429c13dad103693abc38e2556c050025cf4817
3
+ size 5930
dolly-lora-3b/runs/May31_17-28-48_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554131.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.8874.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6128c73e587f0f0276cacf8dca62bfeef1730b5879dd7f2e7c2a9d198c260c31
3
+ size 4309
dolly-lora-3b/runs/May31_17-30-04_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554207.7913668/events.out.tfevents.1685554207.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9110.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:079d66231f1ebdab51f24f9c444c3a31d488fa95bc9ef1c7ed068992b48588f2
3
+ size 5930
dolly-lora-3b/runs/May31_17-30-04_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554207.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9110.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4a37d0fab4bae8c37067eb913b7da6d2c88a7adeb39c593dc2cf5a8f0127ded
3
+ size 4309
dolly-lora-3b/runs/May31_17-34-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554474.8726966/events.out.tfevents.1685554474.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9915.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dccbdf3330ae0a134e4fa97f683e0eb37bc07c4dd62c6f681aa2b76bd95eccb6
3
+ size 5930
dolly-lora-3b/runs/May31_17-34-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554474.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.9915.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fffa738dfab5cf45ba68e04d9e9d17b95321097bfe6f501ae91950e0a4c792c
3
+ size 4309
dolly-lora-3b/runs/May31_17-42-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685554982.2030103/events.out.tfevents.1685554982.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11407.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5403e793d8622a65fb49a01bf25130b93b1bf9b48f457d41ac197b7111fe133e
3
+ size 5930
dolly-lora-3b/runs/May31_17-42-59_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685554982.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11407.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:858665f2997bf7f6929b860a28ad5354a37d0904ef83ec2d4884d61d0582fb6d
3
+ size 4309
dolly-lora-3b/runs/May31_17-44-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685555101.7508595/events.out.tfevents.1685555101.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11777.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3df00314ee19aa289acf77decfd3d558c88d27df64e3136af72ac0c141b84409
3
+ size 5930
dolly-lora-3b/runs/May31_17-44-58_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685555101.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.11777.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32cfb1a287bc6ce94e6ad35d7d02f4fc34087ab0207b7b9c2caad660b8fd2635
3
+ size 4309
dolly-lora-3b/runs/May31_17-50-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/1685555433.7950974/events.out.tfevents.1685555433.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.12764.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6aab8b85c9d211f7b1065237aa35305a9cf6d936feffcec665cf2684195776b6
3
+ size 5930
dolly-lora-3b/runs/May31_17-50-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx/events.out.tfevents.1685555433.w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx.12764.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdcb9d7b807013203bf3b9501c3b84ed5ae6452a48bc67f600899dd2fcd50a18
3
+ size 5735
finetune.py ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ from typing import Dict, List
4
+
5
+ import fire
6
+ import torch
7
+ import transformers
8
+ from datasets import load_dataset
9
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, LlamaTokenizerFast
10
+ from peft import prepare_model_for_kbit_training
11
+ """
12
+ Unused imports:
13
+ import torch.nn as nn
14
+ import bitsandbytes as bnb
15
+ """
16
+
17
+ from peft import (
18
+ LoraConfig,
19
+ get_peft_model,
20
+ get_peft_model_state_dict,
21
+ prepare_model_for_int8_training,
22
+ set_peft_model_state_dict,
23
+ )
24
+ from transformers import LlamaForCausalLM, LlamaTokenizer
25
+
26
+ from utils.prompter import Prompter
27
+ from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR
28
+ from transformers.trainer_callback import TrainerCallback
29
+
30
+ class SavePeftModelCallback(transformers.TrainerCallback):
31
+ def save_model(self, args, state, kwargs):
32
+ print('Saving PEFT checkpoint...')
33
+ if state.best_model_checkpoint is not None:
34
+ checkpoint_folder = os.path.join(state.best_model_checkpoint, "adapter_model")
35
+ else:
36
+ checkpoint_folder = os.path.join(args.output_dir, f"{PREFIX_CHECKPOINT_DIR}-{state.global_step}")
37
+
38
+ peft_model_path = os.path.join(checkpoint_folder, "adapter_model")
39
+ kwargs["model"].save_pretrained(peft_model_path)
40
+
41
+ pytorch_model_path = os.path.join(checkpoint_folder, "pytorch_model.bin")
42
+ if os.path.exists(pytorch_model_path):
43
+ os.remove(pytorch_model_path)
44
+
45
+ def on_save(self, args, state, control, **kwargs):
46
+ self.save_model(args, state, kwargs)
47
+ return control
48
+
49
+ def on_train_end(self, args, state, control, **kwargs):
50
+ def touch(fname, times=None):
51
+ with open(fname, 'a'):
52
+ os.utime(fname, times)
53
+
54
+ touch(os.path.join(args.output_dir, 'completed'))
55
+ self.save_model(args, state, kwargs)
56
+
57
+
58
+ bnb_config = BitsAndBytesConfig(
59
+ load_in_4bit=True,
60
+ bnb_4bit_use_double_quant=True,
61
+ bnb_4bit_quant_type="nf4",
62
+ bnb_4bit_compute_dtype=torch.bfloat16
63
+ )
64
+
65
+ DEFAULT_PAD_TOKEN = "[PAD]"
66
+
67
+ def print_trainable_parameters(model):
68
+ """
69
+ Prints the number of trainable parameters in the model.
70
+ """
71
+ trainable_params = 0
72
+ all_param = 0
73
+ for _, param in model.named_parameters():
74
+ all_param += param.numel()
75
+ if param.requires_grad:
76
+ trainable_params += param.numel()
77
+ print(
78
+ f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
79
+ )
80
+
81
+ def smart_tokenizer_and_embedding_resize(
82
+ special_tokens_dict: Dict,
83
+ tokenizer: transformers.PreTrainedTokenizer,
84
+ model: transformers.PreTrainedModel,
85
+ ):
86
+ """Resize tokenizer and embedding.
87
+
88
+ Note: This is the unoptimized version that may make your embedding size not be divisible by 64.
89
+ """
90
+ num_new_tokens = tokenizer.add_special_tokens(special_tokens_dict)
91
+ model.resize_token_embeddings(len(tokenizer))
92
+
93
+ if num_new_tokens > 0:
94
+ input_embeddings = model.get_input_embeddings().weight.data
95
+ output_embeddings = model.get_output_embeddings().weight.data
96
+
97
+ input_embeddings_avg = input_embeddings[:-num_new_tokens].mean(dim=0, keepdim=True)
98
+ output_embeddings_avg = output_embeddings[:-num_new_tokens].mean(dim=0, keepdim=True)
99
+
100
+ input_embeddings[-num_new_tokens:] = input_embeddings_avg
101
+ output_embeddings[-num_new_tokens:] = output_embeddings_avg
102
+
103
+
104
+ def train(
105
+ # model/data params
106
+ base_model: str = "", # the only required argument
107
+ data_path: str = "",
108
+ output_dir: str = "./lora-alpaca",
109
+ # training hyperparams
110
+ batch_size: int = 128,
111
+ micro_batch_size: int = 4,
112
+ num_epochs: int = 3,
113
+ learning_rate: float = 3e-4,
114
+ cutoff_len: int = 256,
115
+ val_set_size: int = 2000,
116
+ # lora hyperparams
117
+ lora_r: int = 8,
118
+ lora_alpha: int = 16,
119
+ lora_dropout: float = 0.05,
120
+ lora_target_modules: List[str] = [
121
+ "q_proj",
122
+ "v_proj",
123
+ ],
124
+ # llm hyperparams
125
+ train_on_inputs: bool = True, # if False, masks out inputs in loss
126
+ add_eos_token: bool = False,
127
+ group_by_length: bool = False, # faster, but produces an odd training loss curve
128
+ resume_from_checkpoint: str = None, # either training checkpoint or final adapter
129
+ prompt_template_name: str = "alpaca", # The prompt template to use, will default to alpaca.
130
+ ):
131
+ if int(os.environ.get("LOCAL_RANK", 0)) == 0:
132
+ print(
133
+ f"Training Alpaca-LoRA model with params:\n"
134
+ f"base_model: {base_model}\n"
135
+ f"data_path: {data_path}\n"
136
+ f"output_dir: {output_dir}\n"
137
+ f"batch_size: {batch_size}\n"
138
+ f"micro_batch_size: {micro_batch_size}\n"
139
+ f"num_epochs: {num_epochs}\n"
140
+ f"learning_rate: {learning_rate}\n"
141
+ f"cutoff_len: {cutoff_len}\n"
142
+ f"val_set_size: {val_set_size}\n"
143
+ f"lora_r: {lora_r}\n"
144
+ f"lora_alpha: {lora_alpha}\n"
145
+ f"lora_dropout: {lora_dropout}\n"
146
+ f"lora_target_modules: {lora_target_modules}\n"
147
+ f"train_on_inputs: {train_on_inputs}\n"
148
+ f"add_eos_token: {add_eos_token}\n"
149
+ f"group_by_length: {group_by_length}\n"
150
+ f"resume_from_checkpoint: {resume_from_checkpoint or False}\n"
151
+ f"prompt template: {prompt_template_name}\n"
152
+ )
153
+ assert (
154
+ base_model
155
+ ), "Please specify a --base_model, e.g. --base_model='huggyllama/llama-7b'"
156
+ gradient_accumulation_steps = batch_size // micro_batch_size
157
+
158
+ prompter = Prompter(prompt_template_name)
159
+
160
+ device_map = "auto"
161
+ world_size = int(os.environ.get("WORLD_SIZE", 1))
162
+ ddp = world_size != 1
163
+ if ddp:
164
+ device_map = {"": int(os.environ.get("LOCAL_RANK") or 0)}
165
+ gradient_accumulation_steps = gradient_accumulation_steps // world_size
166
+
167
+ model = AutoModelForCausalLM.from_pretrained(
168
+ base_model,
169
+ quantization_config=bnb_config,
170
+ device_map=device_map,
171
+ )
172
+
173
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
174
+
175
+ if tokenizer._pad_token is None:
176
+ smart_tokenizer_and_embedding_resize(
177
+ special_tokens_dict=dict(pad_token=DEFAULT_PAD_TOKEN),
178
+ tokenizer=tokenizer,
179
+ model=model,
180
+ )
181
+ if isinstance(tokenizer, LlamaTokenizerFast):
182
+ # LLaMA tokenizer may not have correct special tokens set.
183
+ # Check and add them if missing to prevent them from being parsed into different tokens.
184
+ # Note that these are present in the vocabulary.
185
+ # Note also that `model.config.pad_token_id` is 0 which corresponds to `<unk>` token.
186
+ tokenizer.eos_token_id = model.config.eos_token_id
187
+ tokenizer.pad_token_id = model.config.pad_token_id
188
+ if hasattr(model.config, 'unk_token_id'):
189
+ tokenizer.unk_token_id = model.config.unk_token_id
190
+ else:
191
+ tokenizer.unk_token_id = tokenizer.pad_token_id
192
+
193
+
194
+ #tokenizer.padding_side = "left" # Allow batched inference
195
+
196
+ def tokenize(prompt, add_eos_token=True):
197
+ # there's probably a way to do this with the tokenizer settings
198
+ # but again, gotta move fast
199
+ result = tokenizer(
200
+ prompt,
201
+ truncation=True,
202
+ max_length=cutoff_len,
203
+ padding=False,
204
+ return_tensors=None,
205
+ )
206
+ if (
207
+ result["input_ids"][-1] != tokenizer.eos_token_id
208
+ and len(result["input_ids"]) < cutoff_len
209
+ and add_eos_token
210
+ ):
211
+ result["input_ids"].append(tokenizer.eos_token_id)
212
+ result["attention_mask"].append(1)
213
+
214
+ result["labels"] = result["input_ids"].copy()
215
+
216
+ return result
217
+
218
+ def generate_and_tokenize_prompt(data_point):
219
+ full_prompt = prompter.generate_prompt(
220
+ data_point["instruction"],
221
+ data_point["input"],
222
+ data_point["output"],
223
+ )
224
+ tokenized_full_prompt = tokenize(full_prompt)
225
+ if not train_on_inputs:
226
+ user_prompt = prompter.generate_prompt(
227
+ data_point["instruction"], data_point["input"]
228
+ )
229
+ tokenized_user_prompt = tokenize(
230
+ user_prompt, add_eos_token=add_eos_token
231
+ )
232
+ user_prompt_len = len(tokenized_user_prompt["input_ids"])
233
+
234
+ if add_eos_token:
235
+ user_prompt_len -= 1
236
+
237
+ tokenized_full_prompt["labels"] = [
238
+ -100
239
+ ] * user_prompt_len + tokenized_full_prompt["labels"][
240
+ user_prompt_len:
241
+ ] # could be sped up, probably
242
+ return tokenized_full_prompt
243
+
244
+ model = prepare_model_for_kbit_training(model)
245
+
246
+ config = LoraConfig(
247
+ r=lora_r,
248
+ lora_alpha=lora_alpha,
249
+ target_modules=lora_target_modules,
250
+ lora_dropout=lora_dropout,
251
+ bias="none",
252
+ task_type="CAUSAL_LM",
253
+ )
254
+ model = get_peft_model(model, config)
255
+
256
+ if data_path.endswith(".json") or data_path.endswith(".jsonl"):
257
+ data = load_dataset("json", data_files=data_path)
258
+ else:
259
+ data = load_dataset(data_path)
260
+
261
+ if resume_from_checkpoint:
262
+ # Check the available weights and load them
263
+ checkpoint_name = os.path.join(
264
+ resume_from_checkpoint, "pytorch_model.bin"
265
+ ) # Full checkpoint
266
+ if not os.path.exists(checkpoint_name):
267
+ checkpoint_name = os.path.join(
268
+ resume_from_checkpoint, "adapter_model.bin"
269
+ ) # only LoRA model - LoRA config above has to fit
270
+ resume_from_checkpoint = (
271
+ False # So the trainer won't try loading its state
272
+ )
273
+ # The two files above have a different name depending on how they were saved, but are actually the same.
274
+ if os.path.exists(checkpoint_name):
275
+ print(f"Restarting from {checkpoint_name}")
276
+ adapters_weights = torch.load(checkpoint_name)
277
+ set_peft_model_state_dict(model, adapters_weights)
278
+ else:
279
+ print(f"Checkpoint {checkpoint_name} not found")
280
+
281
+ print_trainable_parameters(model) # Be more transparent about the % of trainable params.
282
+ if val_set_size > 0:
283
+ train_val = data["train"].train_test_split(
284
+ test_size=val_set_size, shuffle=True, seed=42
285
+ )
286
+ train_data = (
287
+ train_val["train"].shuffle().map(generate_and_tokenize_prompt)
288
+ )
289
+ val_data = (
290
+ train_val["test"].shuffle().map(generate_and_tokenize_prompt)
291
+ )
292
+ else:
293
+ train_data = data["train"].shuffle().map(generate_and_tokenize_prompt)
294
+ val_data = None
295
+
296
+ trainer = transformers.Trainer(
297
+ model=model,
298
+ train_dataset=train_data,
299
+ eval_dataset=val_data,
300
+ args=transformers.TrainingArguments(
301
+ per_device_train_batch_size=micro_batch_size,
302
+ gradient_accumulation_steps=gradient_accumulation_steps,
303
+ warmup_steps=10,
304
+ num_train_epochs=num_epochs,
305
+ learning_rate=learning_rate,
306
+ # fp16=True,
307
+ logging_steps=10,
308
+ optim="paged_adamw_8bit",
309
+ evaluation_strategy="steps" if val_set_size > 0 else "no",
310
+ save_strategy="steps",
311
+ eval_steps=100 if val_set_size > 0 else None,
312
+ save_steps=100,
313
+ output_dir=output_dir,
314
+ save_total_limit=3,
315
+ #load_best_model_at_end=True if val_set_size > 0 else False,
316
+ load_best_model_at_end=False,
317
+ ddp_find_unused_parameters=False if ddp else None,
318
+ group_by_length=group_by_length,
319
+ report_to=None,
320
+ run_name=None,
321
+ ),
322
+ data_collator=transformers.DataCollatorForSeq2Seq(
323
+ tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True
324
+ ),
325
+ callbacks=[SavePeftModelCallback]
326
+ )
327
+ model.config.use_cache = False
328
+
329
+ # if not ddp and torch.cuda.device_count() > 1:
330
+ # # keeps Trainer from trying its own DataParallelism when more than 1 gpu is available
331
+ # model.is_parallelizable = True
332
+ # model.model_parallel = True
333
+
334
+ # old_state_dict = model.state_dict
335
+ # model.state_dict = (
336
+ # lambda self, *_, **__: get_peft_model_state_dict(
337
+ # self, old_state_dict()
338
+ # )
339
+ # ).__get__(model, type(model))
340
+
341
+
342
+ #if torch.__version__ >= "2" and sys.platform != "win32":
343
+ # model = torch.compile(model)
344
+
345
+ trainer.train(resume_from_checkpoint=resume_from_checkpoint)
346
+
347
+ model.save_pretrained(output_dir)
348
+
349
+ print(
350
+ "\n If there's a warning about missing keys above, please disregard :)"
351
+ )
352
+
353
+
354
+ if __name__ == "__main__":
355
+ fire.Fire(train)
356
+
generate.py ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+
4
+ import fire
5
+ import gradio as gr
6
+ import torch
7
+ import transformers
8
+ from peft import PeftModel
9
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
10
+
11
+ from transformers import GenerationConfig, LlamaForCausalLM, LlamaTokenizer
12
+
13
+ from utils.callbacks import Iteratorize, Stream
14
+ from utils.prompter import Prompter
15
+
16
+ if torch.cuda.is_available():
17
+ device = "cuda"
18
+ else:
19
+ device = "cpu"
20
+
21
+ try:
22
+ if torch.backends.mps.is_available():
23
+ device = "mps"
24
+ except: # noqa: E722
25
+ pass
26
+
27
+
28
+ def main(
29
+ load_8bit: bool = False,
30
+ base_model: str = "",
31
+ lora_weights: str = "hfrepo/lora-model",
32
+ prompt_template: str = "", # The prompt template to use, will default to alpaca.
33
+ server_name: str = "0.0.0.0", # Allows to listen on all interfaces by providing '0.
34
+ share_gradio: bool = False,
35
+ ):
36
+ base_model = base_model or os.environ.get("BASE_MODEL", "")
37
+ assert (
38
+ base_model
39
+ ), "Please specify a --base_model, e.g. --base_model='openlm-research/open_llama_3b_600bt_preview'"
40
+
41
+ prompter = Prompter(prompt_template)
42
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
43
+ if device == "cuda":
44
+ model = AutoModelForCausalLM.from_pretrained(
45
+ base_model,
46
+ #load_in_8bit=load_8bit,
47
+ load_in_4bit=True,
48
+ torch_dtype=torch.float16,
49
+ device_map="auto",
50
+ )
51
+ model = PeftModel.from_pretrained(
52
+ model,
53
+ lora_weights,
54
+ torch_dtype=torch.float16,
55
+ # device_map={'': 0}
56
+ )
57
+ elif device == "mps":
58
+ model = LlamaForCausalLM.from_pretrained(
59
+ base_model,
60
+ device_map={"": device},
61
+ torch_dtype=torch.float16,
62
+ )
63
+ model = PeftModel.from_pretrained(
64
+ model,
65
+ lora_weights,
66
+ device_map={"": device},
67
+ torch_dtype=torch.float16,
68
+ )
69
+ else:
70
+ model = LlamaForCausalLM.from_pretrained(
71
+ base_model, device_map={"": device}, low_cpu_mem_usage=True
72
+ )
73
+ model = PeftModel.from_pretrained(
74
+ model,
75
+ lora_weights,
76
+ device_map={"": device},
77
+ )
78
+
79
+ # unwind broken decapoda-research config
80
+ model.config.pad_token_id = tokenizer.pad_token_id = 0 # unk
81
+ model.config.bos_token_id = 1
82
+ model.config.eos_token_id = 2
83
+
84
+ #if not load_8bit:
85
+ # model.half() # seems to fix bugs for some users.
86
+
87
+ model.eval()
88
+ if torch.__version__ >= "2" and sys.platform != "win32":
89
+ model = torch.compile(model)
90
+
91
+ def evaluate(
92
+ instruction,
93
+ input=None,
94
+ temperature=0.1,
95
+ top_p=0.75,
96
+ top_k=40,
97
+ num_beams=4,
98
+ max_new_tokens=128,
99
+ stream_output=False,
100
+ **kwargs,
101
+ ):
102
+ prompt = prompter.generate_prompt(instruction, input)
103
+ inputs = tokenizer(prompt, return_tensors="pt")
104
+ input_ids = inputs["input_ids"].to(device)
105
+ generation_config = GenerationConfig(
106
+ temperature=temperature,
107
+ top_p=top_p,
108
+ top_k=top_k,
109
+ num_beams=num_beams,
110
+ **kwargs,
111
+ )
112
+
113
+ generate_params = {
114
+ "input_ids": input_ids,
115
+ "generation_config": generation_config,
116
+ "return_dict_in_generate": True,
117
+ "output_scores": True,
118
+ "max_new_tokens": max_new_tokens,
119
+ }
120
+
121
+ if stream_output:
122
+ # Stream the reply 1 token at a time.
123
+ # This is based on the trick of using 'stopping_criteria' to create an iterator,
124
+ # from https://github.com/oobabooga/text-generation-webui/blob/ad37f396fc8bcbab90e11ecf17c56c97bfbd4a9c/modules/text_generation.py#L216-L243.
125
+
126
+ def generate_with_callback(callback=None, **kwargs):
127
+ kwargs.setdefault(
128
+ "stopping_criteria", transformers.StoppingCriteriaList()
129
+ )
130
+ kwargs["stopping_criteria"].append(
131
+ Stream(callback_func=callback)
132
+ )
133
+ with torch.no_grad():
134
+ model.generate(**kwargs)
135
+
136
+ def generate_with_streaming(**kwargs):
137
+ return Iteratorize(
138
+ generate_with_callback, kwargs, callback=None
139
+ )
140
+
141
+ with generate_with_streaming(**generate_params) as generator:
142
+ for output in generator:
143
+ # new_tokens = len(output) - len(input_ids[0])
144
+ decoded_output = tokenizer.decode(output)
145
+
146
+ if output[-1] in [tokenizer.eos_token_id]:
147
+ break
148
+
149
+ yield prompter.get_response(decoded_output)
150
+ return # early return for stream_output
151
+
152
+ # Without streaming
153
+ with torch.no_grad():
154
+ generation_output = model.generate(
155
+ input_ids=input_ids,
156
+ generation_config=generation_config,
157
+ return_dict_in_generate=True,
158
+ output_scores=True,
159
+ max_new_tokens=max_new_tokens,
160
+ )
161
+ s = generation_output.sequences[0]
162
+ output = tokenizer.decode(s)
163
+ yield prompter.get_response(output)
164
+
165
+ gr.Interface(
166
+ fn=evaluate,
167
+ inputs=[
168
+ gr.components.Textbox(
169
+ lines=2,
170
+ label="Instruction",
171
+ placeholder="Tell me about alpacas.",
172
+ ),
173
+ gr.components.Textbox(lines=2, label="Input", placeholder="none"),
174
+ gr.components.Slider(
175
+ minimum=0, maximum=1, value=0.1, label="Temperature"
176
+ ),
177
+ gr.components.Slider(
178
+ minimum=0, maximum=1, value=0.75, label="Top p"
179
+ ),
180
+ gr.components.Slider(
181
+ minimum=0, maximum=100, step=1, value=40, label="Top k"
182
+ ),
183
+ gr.components.Slider(
184
+ minimum=1, maximum=4, step=1, value=4, label="Beams"
185
+ ),
186
+ gr.components.Slider(
187
+ minimum=1, maximum=2000, step=1, value=128, label="Max tokens"
188
+ ),
189
+ gr.components.Checkbox(label="Stream output"),
190
+ ],
191
+ outputs=[
192
+ gr.inputs.Textbox(
193
+ lines=5,
194
+ label="Output",
195
+ )
196
+ ],
197
+ title="🦙🌲 Alpaca-QLoRA",
198
+ description="Instruct-tune Open LLaMA on consumer hardware using QLoRA", # noqa: E501
199
+ ).queue().launch(server_name="0.0.0.0", share=share_gradio)
200
+ # Old testing code follows.
201
+
202
+ """
203
+ # testing code for readme
204
+ for instruction in [
205
+ "Tell me about alpacas.",
206
+ "Tell me about the president of Mexico in 2019.",
207
+ "Tell me about the king of France in 2019.",
208
+ "List all Canadian provinces in alphabetical order.",
209
+ "Write a Python program that prints the first 10 Fibonacci numbers.",
210
+ "Write a program that prints the numbers from 1 to 100. But for multiples of three print 'Fizz' instead of the number and for the multiples of five print 'Buzz'. For numbers which are multiples of both three and five print 'FizzBuzz'.", # noqa: E501
211
+ "Tell me five words that rhyme with 'shock'.",
212
+ "Translate the sentence 'I have no mouth but I must scream' into Spanish.",
213
+ "Count up from 1 to 500.",
214
+ ]:
215
+ print("Instruction:", instruction)
216
+ print("Response:", evaluate(instruction))
217
+ print()
218
+ """
219
+
220
+
221
+ if __name__ == "__main__":
222
+ fire.Fire(main)
requirements.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bitsandbytes
2
+ git+https://github.com/huggingface/transformers.git
3
+ git+https://github.com/huggingface/peft.git
4
+ git+https://github.com/huggingface/accelerate.git
5
+ datasets
6
+ fire
7
+ scipy
8
+ sentencepiece
9
+ protobuf==3.20.0
10
+ wandb
11
+ gradio
templates/README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Prompt templates
2
+
3
+ This directory contains template styles for the prompts used to finetune LoRA models.
4
+
5
+ ## Format
6
+
7
+ A template is described via a JSON file with the following keys:
8
+
9
+ - `prompt_input`: The template to use when input is not None. Uses `{instruction}` and `{input}` placeholders.
10
+ - `prompt_no_input`: The template to use when input is None. Uses `{instruction}` placeholders.
11
+ - `description`: A short description of the template, with possible use cases.
12
+ - `response_split`: The text to use as separator when cutting real response from the model output.
13
+
14
+ No `{response}` placeholder was used, since the response is always the last element of the template and is just to be concatenated to the rest.
15
+
16
+ ## Example template
17
+
18
+ The default template, used unless otherwise specified, is `alpaca.json`
19
+
20
+ ```json
21
+ {
22
+ "description": "Template used by Alpaca-LoRA.",
23
+ "prompt_input": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:\n",
24
+ "prompt_no_input": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:\n",
25
+ "response_split": "### Response:"
26
+ }
27
+
28
+ ```
29
+
30
+ ## Current templates
31
+
32
+ ### alpaca
33
+
34
+ Default template used for generic LoRA fine tunes so far.
35
+
36
+ ### alpaca_legacy
37
+
38
+ Legacy template used by the original alpaca repo, with no `\n` after the response field. Kept for reference and experiments.
39
+
40
+ ### alpaca_short
41
+
42
+ A trimmed down alpaca template which seems to perform just as well and spare some tokens. Models created with the default template seem to be queryable by the short tempalte as well. More experiments are welcome.
43
+
44
+ ### vigogne
45
+
46
+ The default alpaca template, translated to french. This template was used to train the "Vigogne" LoRA and is to be used to query it, or for extra fine tuning.
templates/alpaca.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "Template used by Alpaca-LoRA.",
3
+ "prompt_input": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:\n",
4
+ "prompt_no_input": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:\n",
5
+ "response_split": "### Response:"
6
+ }
templates/alpaca_legacy.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "Legacy template, used by Original Alpaca repository.",
3
+ "prompt_input": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:",
4
+ "prompt_no_input": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:",
5
+ "response_split": "### Response:"
6
+ }
templates/alpaca_short.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "A shorter template to experiment with.",
3
+ "prompt_input": "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:\n",
4
+ "prompt_no_input": "### Instruction:\n{instruction}\n\n### Response:\n",
5
+ "response_split": "### Response:"
6
+ }
templates/vigogne.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "description": "French template, used by Vigogne for finetuning.",
3
+ "prompt_input": "Ci-dessous se trouve une instruction qui décrit une tâche, associée à une entrée qui fournit un contexte supplémentaire. Écrivez une réponse qui complète correctement la demande.\n\n### Instruction:\n{instruction}\n\n### Entrée:\n{input}\n\n### Réponse:\n",
4
+ "prompt_no_input": "Ci-dessous se trouve une instruction qui décrit une tâche. Écrivez une réponse qui complète correctement la demande.\n\n### Instruction:\n{instruction}\n\n### Réponse:\n",
5
+ "response_split": "### Réponse:"
6
+ }
utils/README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Directory for helpers modules
2
+
3
+ ## prompter.py
4
+
5
+ Prompter class, a template manager.
6
+
7
+ `from utils.prompter import Prompter`
8
+
9
+ ## callbacks.py
10
+
11
+ Helpers to support streaming generate output.
12
+
13
+ `from utils.callbacks import Iteratorize, Stream`
utils/__init__.py ADDED
File without changes
utils/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (144 Bytes). View file
 
utils/__pycache__/prompter.cpython-39.pyc ADDED
Binary file (1.64 kB). View file
 
utils/callbacks.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Helpers to support streaming generate output.
3
+ Borrowed from https://github.com/oobabooga/text-generation-webui/blob/ad37f396fc8bcbab90e11ecf17c56c97bfbd4a9c/modules/callbacks.py
4
+ """
5
+
6
+ import gc
7
+ import traceback
8
+ from queue import Queue
9
+ from threading import Thread
10
+
11
+ import torch
12
+ import transformers
13
+
14
+
15
+ class Stream(transformers.StoppingCriteria):
16
+ def __init__(self, callback_func=None):
17
+ self.callback_func = callback_func
18
+
19
+ def __call__(self, input_ids, scores) -> bool:
20
+ if self.callback_func is not None:
21
+ self.callback_func(input_ids[0])
22
+ return False
23
+
24
+
25
+ class Iteratorize:
26
+
27
+ """
28
+ Transforms a function that takes a callback
29
+ into a lazy iterator (generator).
30
+ """
31
+
32
+ def __init__(self, func, kwargs={}, callback=None):
33
+ self.mfunc = func
34
+ self.c_callback = callback
35
+ self.q = Queue()
36
+ self.sentinel = object()
37
+ self.kwargs = kwargs
38
+ self.stop_now = False
39
+
40
+ def _callback(val):
41
+ if self.stop_now:
42
+ raise ValueError
43
+ self.q.put(val)
44
+
45
+ def gentask():
46
+ try:
47
+ ret = self.mfunc(callback=_callback, **self.kwargs)
48
+ except ValueError:
49
+ pass
50
+ except:
51
+ traceback.print_exc()
52
+ pass
53
+
54
+ self.q.put(self.sentinel)
55
+ if self.c_callback:
56
+ self.c_callback(ret)
57
+
58
+ self.thread = Thread(target=gentask)
59
+ self.thread.start()
60
+
61
+ def __iter__(self):
62
+ return self
63
+
64
+ def __next__(self):
65
+ obj = self.q.get(True, None)
66
+ if obj is self.sentinel:
67
+ raise StopIteration
68
+ else:
69
+ return obj
70
+
71
+ def __enter__(self):
72
+ return self
73
+
74
+ def __exit__(self, exc_type, exc_val, exc_tb):
75
+ self.stop_now = True
utils/prompter.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ A dedicated helper to manage templates and prompt building.
3
+ """
4
+
5
+ import json
6
+ import os.path as osp
7
+ from typing import Union
8
+
9
+
10
+ class Prompter(object):
11
+ __slots__ = ("template", "_verbose")
12
+
13
+ def __init__(self, template_name: str = "", verbose: bool = False):
14
+ self._verbose = verbose
15
+ if not template_name:
16
+ # Enforce the default here, so the constructor can be called with '' and will not break.
17
+ template_name = "alpaca"
18
+ file_name = osp.join("templates", f"{template_name}.json")
19
+ if not osp.exists(file_name):
20
+ raise ValueError(f"Can't read {file_name}")
21
+ with open(file_name) as fp:
22
+ self.template = json.load(fp)
23
+ if self._verbose:
24
+ print(
25
+ f"Using prompt template {template_name}: {self.template['description']}"
26
+ )
27
+
28
+ def generate_prompt(
29
+ self,
30
+ instruction: str,
31
+ input: Union[None, str] = None,
32
+ label: Union[None, str] = None,
33
+ ) -> str:
34
+ # returns the full prompt from instruction and optional input
35
+ # if a label (=response, =output) is provided, it's also appended.
36
+ if input:
37
+ res = self.template["prompt_input"].format(
38
+ instruction=instruction, input=input
39
+ )
40
+ else:
41
+ res = self.template["prompt_no_input"].format(
42
+ instruction=instruction
43
+ )
44
+ if label:
45
+ res = f"{res}{label}"
46
+ if self._verbose:
47
+ print(res)
48
+ return res
49
+
50
+ def get_response(self, output: str) -> str:
51
+ return output.split(self.template["response_split"])[1].strip()
wandb/debug-cli.root.log ADDED
File without changes
wandb/debug-internal.log ADDED
@@ -0,0 +1 @@
 
 
1
+ run-20230531_170802-zezjqg86/logs/debug-internal.log
wandb/debug.log ADDED
@@ -0,0 +1 @@
 
 
1
+ run-20230531_170802-zezjqg86/logs/debug.log
wandb/latest-run ADDED
@@ -0,0 +1 @@
 
 
1
+ run-20230531_170802-zezjqg86
wandb/run-20230531_164935-4dg4abji/files/conda-environment.yaml ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: saturn
2
+ channels:
3
+ - pytorch
4
+ - fastai
5
+ - rapidsai
6
+ - conda-forge
7
+ - defaults
8
+ dependencies:
9
+ - _libgcc_mutex=0.1=conda_forge
10
+ - _openmp_mutex=4.5=2_kmp_llvm
11
+ - abseil-cpp=20211102.0=h93e1e8c_3
12
+ - absl-py=1.4.0=pyhd8ed1ab_0
13
+ - aiobotocore=2.2.0=pyhd8ed1ab_0
14
+ - aiohttp=3.8.4=py39h72bdee0_0
15
+ - aioitertools=0.11.0=pyhd8ed1ab_0
16
+ - aiosignal=1.3.1=pyhd8ed1ab_0
17
+ - alsa-lib=1.2.8=h166bdaf_0
18
+ - anyio=3.6.2=pyhd8ed1ab_0
19
+ - aom=3.5.0=h27087fc_0
20
+ - argon2-cffi=21.3.0=pyhd8ed1ab_0
21
+ - argon2-cffi-bindings=21.2.0=py39hb9d737c_3
22
+ - arrow-cpp=6.0.1=py39h461039b_20_cpu
23
+ - asttokens=2.2.1=pyhd8ed1ab_0
24
+ - async-timeout=4.0.2=pyhd8ed1ab_0
25
+ - atk-1.0=2.38.0=hd4edc92_1
26
+ - attr=2.5.1=h166bdaf_1
27
+ - attrs=22.2.0=pyh71513ae_0
28
+ - aws-c-cal=0.5.11=h95a6274_0
29
+ - aws-c-common=0.6.2=h7f98852_0
30
+ - aws-c-event-stream=0.2.7=h3541f99_13
31
+ - aws-c-io=0.10.5=hfb6a706_0
32
+ - aws-checksums=0.1.11=ha31a3da_7
33
+ - aws-sdk-cpp=1.8.186=hecaee15_4
34
+ - backcall=0.2.0=pyh9f0ad1d_0
35
+ - backports=1.0=pyhd8ed1ab_3
36
+ - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
37
+ - bcrypt=3.2.2=py39hb9d737c_1
38
+ - beautifulsoup4=4.11.2=pyha770c72_0
39
+ - blas=2.114=mkl
40
+ - blas-devel=3.9.0=14_linux64_mkl
41
+ - bleach=6.0.0=pyhd8ed1ab_0
42
+ - blinker=1.5=pyhd8ed1ab_0
43
+ - bokeh=2.4.3=pyhd8ed1ab_3
44
+ - botocore=1.24.21=pyhd8ed1ab_1
45
+ - brotli=1.0.9=h166bdaf_8
46
+ - brotli-bin=1.0.9=h166bdaf_8
47
+ - brotlipy=0.7.0=py39hb9d737c_1005
48
+ - bzip2=1.0.8=h7f98852_4
49
+ - c-ares=1.18.1=h7f98852_0
50
+ - ca-certificates=2022.12.7=ha878542_0
51
+ - cachetools=5.3.0=pyhd8ed1ab_0
52
+ - cairo=1.16.0=ha61ee94_1014
53
+ - catalogue=2.0.8=py39hf3d152e_1
54
+ - certifi=2022.12.7=pyhd8ed1ab_0
55
+ - cffi=1.15.1=py39he91dace_3
56
+ - click=8.0.4=py39hf3d152e_0
57
+ - cloudpickle=2.2.1=pyhd8ed1ab_0
58
+ - colorama=0.4.6=pyhd8ed1ab_0
59
+ - commonmark=0.9.1=py_0
60
+ - confection=0.0.4=py39hcca971b_1
61
+ - croniter=0.3.36=pyhd8ed1ab_0
62
+ - cudatoolkit=11.3.1=h9edb442_11
63
+ - cycler=0.11.0=pyhd8ed1ab_0
64
+ - cymem=2.0.7=py39h5a03fae_1
65
+ - cython-blis=0.7.9=py39h2ae25f5_1
66
+ - cytoolz=0.12.0=py39hb9d737c_1
67
+ - dask=2022.3.0=pyhd8ed1ab_1
68
+ - dask-core=2022.3.0=pyhd8ed1ab_0
69
+ - dask-cuda=22.04.00=py39_0
70
+ - dataclasses=0.8=pyhc8e2a94_3
71
+ - dbus=1.13.6=h5008d03_3
72
+ - debugpy=1.6.6=py39h227be39_0
73
+ - decorator=5.1.1=pyhd8ed1ab_0
74
+ - defusedxml=0.7.1=pyhd8ed1ab_0
75
+ - distributed=2022.3.0=pyhd8ed1ab_0
76
+ - docker-py=6.0.0=pyhd8ed1ab_0
77
+ - entrypoints=0.4=pyhd8ed1ab_0
78
+ - executing=1.2.0=pyhd8ed1ab_0
79
+ - expat=2.5.0=h27087fc_0
80
+ - fastai=2.6.3=py_0
81
+ - fastcore=1.4.5=py_0
82
+ - fastdownload=0.0.7=py_0
83
+ - fastprogress=1.0.3=py_0
84
+ - ffmpeg=4.4.2=gpl_h8dda1f0_112
85
+ - fftw=3.3.10=nompi_hf0379b8_106
86
+ - flit-core=3.8.0=pyhd8ed1ab_0
87
+ - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
88
+ - font-ttf-inconsolata=3.000=h77eed37_0
89
+ - font-ttf-source-code-pro=2.038=h77eed37_0
90
+ - font-ttf-ubuntu=0.83=hab24e00_0
91
+ - fontconfig=2.14.2=h14ed4e7_0
92
+ - fonts-conda-ecosystem=1=0
93
+ - fonts-conda-forge=1=0
94
+ - fonttools=4.39.0=py39h72bdee0_0
95
+ - freeglut=3.2.2=h9c3ff4c_1
96
+ - freetype=2.12.1=hca18f0e_1
97
+ - fribidi=1.0.10=h36c2ea0_0
98
+ - frozenlist=1.3.3=py39hb9d737c_0
99
+ - fsspec=2022.3.0=pyhd8ed1ab_0
100
+ - future=0.18.3=pyhd8ed1ab_0
101
+ - gdk-pixbuf=2.42.8=hff1cb4f_1
102
+ - gettext=0.21.1=h27087fc_0
103
+ - gflags=2.2.2=he1b5a44_1004
104
+ - giflib=5.2.1=h0b41bf4_3
105
+ - glib=2.74.1=h6239696_1
106
+ - glib-tools=2.74.1=h6239696_1
107
+ - glog=0.6.0=h6f12383_0
108
+ - gmp=6.2.1=h58526e2_0
109
+ - gnutls=3.7.8=hf3e180e_0
110
+ - google-auth=2.16.2=pyh1a96a4e_0
111
+ - google-auth-oauthlib=0.4.6=pyhd8ed1ab_0
112
+ - graphite2=1.3.13=h58526e2_1001
113
+ - graphviz=5.0.0=h5abf519_0
114
+ - grpc-cpp=1.46.3=hc275302_1
115
+ - grpcio=1.46.3=py39hf176720_1
116
+ - gst-plugins-base=1.21.3=h4243ec0_1
117
+ - gstreamer=1.21.3=h25f0c4b_1
118
+ - gstreamer-orc=0.4.33=h166bdaf_0
119
+ - gtk2=2.24.33=h90689f9_2
120
+ - gts=0.7.6=h64030ff_2
121
+ - harfbuzz=4.4.1=hf9f4e7c_0
122
+ - hdf5=1.12.1=nompi_h2386368_104
123
+ - heapdict=1.0.1=py_0
124
+ - icu=70.1=h27087fc_0
125
+ - idna=3.4=pyhd8ed1ab_0
126
+ - importlib-metadata=6.0.0=pyha770c72_0
127
+ - importlib_resources=5.12.0=pyhd8ed1ab_0
128
+ - ipykernel=6.13.0=py39hef51801_0
129
+ - ipython=8.11.0=pyh41d4057_0
130
+ - ipython_genutils=0.2.0=py_1
131
+ - ipywidgets=7.7.0=pyhd8ed1ab_0
132
+ - jack=1.9.22=h11f4161_0
133
+ - jasper=2.0.33=h0ff4b12_1
134
+ - jedi=0.18.2=pyhd8ed1ab_0
135
+ - jinja2=3.1.2=pyhd8ed1ab_1
136
+ - jmespath=1.0.1=pyhd8ed1ab_0
137
+ - joblib=1.2.0=pyhd8ed1ab_0
138
+ - jpeg=9e=h0b41bf4_3
139
+ - jsonschema=4.17.3=pyhd8ed1ab_0
140
+ - jupyter_client=7.3.4=pyhd8ed1ab_0
141
+ - jupyter_core=5.2.0=py39hf3d152e_0
142
+ - jupyter_server=1.23.6=pyhd8ed1ab_0
143
+ - jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
144
+ - jupyterlab_widgets=1.1.2=pyhd8ed1ab_0
145
+ - keyutils=1.6.1=h166bdaf_0
146
+ - kiwisolver=1.4.4=py39hf939315_1
147
+ - krb5=1.20.1=hf9c8cef_0
148
+ - lame=3.100=h166bdaf_1003
149
+ - langcodes=3.3.0=pyhd8ed1ab_0
150
+ - lcms2=2.14=h6ed2654_0
151
+ - ld_impl_linux-64=2.40=h41732ed_0
152
+ - lerc=4.0.0=h27087fc_0
153
+ - libabseil=20211102.0=cxx17_h48a1fff_3
154
+ - libblas=3.9.0=14_linux64_mkl
155
+ - libbrotlicommon=1.0.9=h166bdaf_8
156
+ - libbrotlidec=1.0.9=h166bdaf_8
157
+ - libbrotlienc=1.0.9=h166bdaf_8
158
+ - libcap=2.66=ha37c62d_0
159
+ - libcblas=3.9.0=14_linux64_mkl
160
+ - libclang=15.0.7=default_had23c3d_1
161
+ - libclang13=15.0.7=default_h3e3d535_1
162
+ - libcups=2.3.3=h36d4200_3
163
+ - libcurl=7.87.0=h6312ad2_0
164
+ - libdb=6.2.32=h9c3ff4c_0
165
+ - libdeflate=1.14=h166bdaf_0
166
+ - libdrm=2.4.114=h166bdaf_0
167
+ - libedit=3.1.20191231=he28a2e2_2
168
+ - libev=4.33=h516909a_1
169
+ - libevent=2.1.10=h9b69904_4
170
+ - libffi=3.4.2=h7f98852_5
171
+ - libflac=1.4.2=h27087fc_0
172
+ - libgcc-ng=12.2.0=h65d4601_19
173
+ - libgcrypt=1.10.1=h166bdaf_0
174
+ - libgd=2.3.3=h18fbbfe_3
175
+ - libgfortran-ng=12.2.0=h69a702a_19
176
+ - libgfortran5=12.2.0=h337968e_19
177
+ - libglib=2.74.1=h606061b_1
178
+ - libglu=9.0.0=he1b5a44_1001
179
+ - libgpg-error=1.46=h620e276_0
180
+ - libhwloc=2.9.0=hd6dc26d_0
181
+ - libiconv=1.17=h166bdaf_0
182
+ - libidn2=2.3.4=h166bdaf_0
183
+ - liblapack=3.9.0=14_linux64_mkl
184
+ - liblapacke=3.9.0=14_linux64_mkl
185
+ - libllvm11=11.1.0=he0ac6c6_5
186
+ - libllvm15=15.0.7=hadd5161_1
187
+ - libnghttp2=1.51.0=hdcd2b5c_0
188
+ - libnsl=2.0.0=h7f98852_0
189
+ - libogg=1.3.4=h7f98852_1
190
+ - libopencv=4.5.5=py39hd011c1b_13
191
+ - libopus=1.3.1=h7f98852_1
192
+ - libpciaccess=0.17=h166bdaf_0
193
+ - libpng=1.6.39=h753d276_0
194
+ - libpq=15.1=h2baec63_3
195
+ - libprotobuf=3.20.2=h6239696_0
196
+ - librsvg=2.54.4=h7abd40a_0
197
+ - libsndfile=1.2.0=hb75c966_0
198
+ - libsodium=1.0.18=h36c2ea0_1
199
+ - libsqlite=3.40.0=h753d276_0
200
+ - libssh2=1.10.0=haa6b8db_3
201
+ - libstdcxx-ng=12.2.0=h46fd767_19
202
+ - libsystemd0=252=h2a991cd_0
203
+ - libtasn1=4.19.0=h166bdaf_0
204
+ - libthrift=0.16.0=h491838f_2
205
+ - libtiff=4.4.0=h82bc61c_5
206
+ - libtool=2.4.7=h27087fc_0
207
+ - libudev1=253=h0b41bf4_0
208
+ - libunistring=0.9.10=h7f98852_0
209
+ - libutf8proc=2.8.0=h166bdaf_0
210
+ - libuuid=2.32.1=h7f98852_1000
211
+ - libuv=1.44.2=h166bdaf_0
212
+ - libva=2.17.0=h0b41bf4_0
213
+ - libvorbis=1.3.7=h9c3ff4c_0
214
+ - libvpx=1.11.0=h9c3ff4c_3
215
+ - libwebp=1.2.4=h522a892_0
216
+ - libwebp-base=1.2.4=h166bdaf_0
217
+ - libxcb=1.13=h7f98852_1004
218
+ - libxkbcommon=1.5.0=h79f4944_1
219
+ - libxml2=2.10.3=hca2bb57_3
220
+ - libzlib=1.2.13=h166bdaf_4
221
+ - llvm-openmp=15.0.7=h0cdce71_0
222
+ - llvmlite=0.39.1=py39h7d9a04d_1
223
+ - locket=1.0.0=pyhd8ed1ab_0
224
+ - lz4=4.3.2=py39h724f13c_0
225
+ - lz4-c=1.9.4=hcb278e6_0
226
+ - markdown=3.4.1=pyhd8ed1ab_0
227
+ - markupsafe=2.1.2=py39h72bdee0_0
228
+ - marshmallow=3.19.0=pyhd8ed1ab_0
229
+ - marshmallow-oneofschema=3.0.1=pyhd8ed1ab_0
230
+ - matplotlib=3.5.2=py39hf3d152e_1
231
+ - matplotlib-base=3.5.2=py39h700656a_1
232
+ - matplotlib-inline=0.1.6=pyhd8ed1ab_0
233
+ - mistune=2.0.5=pyhd8ed1ab_0
234
+ - mkl=2022.0.1=h8d4b97c_803
235
+ - mkl-devel=2022.0.1=ha770c72_804
236
+ - mkl-include=2022.0.1=h8d4b97c_803
237
+ - mpg123=1.31.2=hcb278e6_0
238
+ - msgpack-python=1.0.5=py39h4b4f3f3_0
239
+ - multidict=6.0.4=py39h72bdee0_0
240
+ - munkres=1.1.4=pyh9f0ad1d_0
241
+ - murmurhash=1.0.9=py39h5a03fae_1
242
+ - mypy_extensions=1.0.0=pyha770c72_0
243
+ - mysql-common=8.0.32=h14678bc_0
244
+ - mysql-libs=8.0.32=h54cf53e_0
245
+ - natsort=8.3.1=pyhd8ed1ab_0
246
+ - nbclassic=0.5.3=pyhb4ecaf3_3
247
+ - nbclient=0.7.2=pyhd8ed1ab_0
248
+ - nbconvert=7.2.9=pyhd8ed1ab_0
249
+ - nbconvert-core=7.2.9=pyhd8ed1ab_0
250
+ - nbconvert-pandoc=7.2.9=pyhd8ed1ab_0
251
+ - nbformat=5.7.3=pyhd8ed1ab_0
252
+ - ncurses=6.3=h27087fc_1
253
+ - nest-asyncio=1.5.6=pyhd8ed1ab_0
254
+ - nettle=3.8.1=hc379101_1
255
+ - notebook=6.5.3=pyha770c72_0
256
+ - notebook-shim=0.2.2=pyhd8ed1ab_0
257
+ - nspr=4.35=h27087fc_0
258
+ - nss=3.89=he45b914_0
259
+ - numba=0.56.4=py39h61ddf18_0
260
+ - numpy=1.21.6=py39h18676bf_0
261
+ - oauthlib=3.2.2=pyhd8ed1ab_0
262
+ - openh264=2.3.1=hcb278e6_2
263
+ - openjpeg=2.5.0=h7d73246_1
264
+ - openssl=1.1.1t=h0b41bf4_0
265
+ - orc=1.7.5=h6c59b99_0
266
+ - p11-kit=0.24.1=hc5aa10d_0
267
+ - packaging=23.0=pyhd8ed1ab_0
268
+ - pandas=1.4.2=py39h1832856_2
269
+ - pandoc=3.1.1=h32600fe_0
270
+ - pandocfilters=1.5.0=pyhd8ed1ab_0
271
+ - pango=1.50.8=hbd2fdc8_0
272
+ - paramiko=3.1.0=pyhd8ed1ab_0
273
+ - parquet-cpp=1.5.1=2
274
+ - parso=0.8.3=pyhd8ed1ab_0
275
+ - partd=1.3.0=pyhd8ed1ab_0
276
+ - pathy=0.10.1=pyhd8ed1ab_0
277
+ - pcre2=10.40=hc3806b6_0
278
+ - pendulum=2.1.2=py39h72bdee0_5
279
+ - pexpect=4.8.0=pyh1a96a4e_2
280
+ - pickleshare=0.7.5=py_1003
281
+ - pillow=9.1.1=py39hae2aec6_1
282
+ - pip=23.0.1=pyhd8ed1ab_0
283
+ - pixman=0.40.0=h36c2ea0_0
284
+ - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
285
+ - platformdirs=3.1.1=pyhd8ed1ab_0
286
+ - ply=3.11=py_1
287
+ - pooch=1.7.0=pyhd8ed1ab_0
288
+ - prefect=0.15.13=pyhd8ed1ab_0
289
+ - preshed=3.0.8=py39h5a03fae_1
290
+ - prometheus_client=0.16.0=pyhd8ed1ab_0
291
+ - prompt-toolkit=3.0.38=pyha770c72_0
292
+ - prompt_toolkit=3.0.38=hd8ed1ab_0
293
+ - psutil=5.9.4=py39hb9d737c_0
294
+ - pthread-stubs=0.4=h36c2ea0_1001
295
+ - ptyprocess=0.7.0=pyhd3deb0d_0
296
+ - pulseaudio=16.1=h4ab2085_1
297
+ - pure_eval=0.2.2=pyhd8ed1ab_0
298
+ - py-opencv=4.5.5=py39hef51801_13
299
+ - pyasn1=0.4.8=py_0
300
+ - pyasn1-modules=0.2.7=py_0
301
+ - pycparser=2.21=pyhd8ed1ab_0
302
+ - pydantic=1.10.6=py39h72bdee0_0
303
+ - pygments=2.14.0=pyhd8ed1ab_0
304
+ - pyjwt=2.6.0=pyhd8ed1ab_0
305
+ - pynacl=1.5.0=py39hb9d737c_2
306
+ - pynvml=11.4.1=pyhd8ed1ab_0
307
+ - pyparsing=3.0.9=pyhd8ed1ab_0
308
+ - pyqt=5.15.7=py39h5c7b992_3
309
+ - pyqt5-sip=12.11.0=py39h227be39_3
310
+ - pyrsistent=0.19.3=py39h72bdee0_0
311
+ - pysocks=1.7.1=pyha2e5f31_6
312
+ - python=3.9.15=h47a2c10_0_cpython
313
+ - python-box=7.0.0=py39h72bdee0_0
314
+ - python-dateutil=2.8.2=pyhd8ed1ab_0
315
+ - python-fastjsonschema=2.16.3=pyhd8ed1ab_0
316
+ - python-graphviz=0.20.1=pyh22cad53_0
317
+ - python-slugify=8.0.1=pyhd8ed1ab_1
318
+ - python_abi=3.9=3_cp39
319
+ - pytorch-mutex=1.0=cuda
320
+ - pytz=2022.7.1=pyhd8ed1ab_0
321
+ - pytzdata=2020.1=pyh9f0ad1d_0
322
+ - pyu2f=0.1.5=pyhd8ed1ab_0
323
+ - pywin32-on-windows=0.1.0=pyh1179c8e_3
324
+ - pyyaml=6.0=py39hb9d737c_5
325
+ - pyzmq=25.0.1=py39h0be026e_0
326
+ - qt-main=5.15.6=h62441b5_5
327
+ - re2=2022.04.01=h27087fc_0
328
+ - readline=8.1.2=h0f457ee_0
329
+ - requests=2.28.2=pyhd8ed1ab_0
330
+ - requests-oauthlib=1.3.1=pyhd8ed1ab_0
331
+ - rich=12.6.0=pyhd8ed1ab_0
332
+ - rsa=4.9=pyhd8ed1ab_0
333
+ - ruamel.yaml=0.17.21=py39h72bdee0_3
334
+ - ruamel.yaml.clib=0.2.7=py39h72bdee0_1
335
+ - s2n=1.0.10=h9b69904_0
336
+ - s3fs=2022.3.0=pyhd8ed1ab_0
337
+ - scikit-learn=1.2.2=py39h86b2a18_0
338
+ - scipy=1.10.1=py39h7360e5f_0
339
+ - send2trash=1.8.0=pyhd8ed1ab_0
340
+ - setuptools=59.8.0=py39hf3d152e_1
341
+ - shellingham=1.5.1=pyhd8ed1ab_0
342
+ - sip=6.7.7=py39h227be39_0
343
+ - six=1.16.0=pyh6c4a22f_0
344
+ - smart_open=5.2.1=pyhd8ed1ab_0
345
+ - snappy=1.1.10=h9fff704_0
346
+ - sniffio=1.3.0=pyhd8ed1ab_0
347
+ - sortedcontainers=2.4.0=pyhd8ed1ab_0
348
+ - soupsieve=2.3.2.post1=pyhd8ed1ab_0
349
+ - spacy=3.5.1=py39h0354152_0
350
+ - spacy-legacy=3.0.12=pyhd8ed1ab_0
351
+ - spacy-loggers=1.0.4=pyhd8ed1ab_0
352
+ - srsly=2.4.6=py39h227be39_0
353
+ - stack_data=0.6.2=pyhd8ed1ab_0
354
+ - svt-av1=1.4.1=hcb278e6_0
355
+ - tabulate=0.9.0=pyhd8ed1ab_1
356
+ - tbb=2021.8.0=hf52228f_0
357
+ - tblib=1.7.0=pyhd8ed1ab_0
358
+ - tensorboard=2.9.0=pyhd8ed1ab_0
359
+ - tensorboard-data-server=0.6.1=py39hd97740a_4
360
+ - tensorboard-plugin-wit=1.8.1=pyhd8ed1ab_0
361
+ - terminado=0.17.1=pyh41d4057_0
362
+ - text-unidecode=1.3=py_0
363
+ - thinc=8.1.9=py39h0354152_0
364
+ - threadpoolctl=3.1.0=pyh8a188c0_0
365
+ - tinycss2=1.2.1=pyhd8ed1ab_0
366
+ - tk=8.6.12=h27826a3_0
367
+ - toml=0.10.2=pyhd8ed1ab_0
368
+ - toolz=0.12.0=pyhd8ed1ab_0
369
+ - torchaudio=0.11.0=py39_cu113
370
+ - torchvision=0.12.0=py39_cu113
371
+ - tornado=6.1=py39hb9d737c_3
372
+ - tqdm=4.65.0=pyhd8ed1ab_1
373
+ - traitlets=5.9.0=pyhd8ed1ab_0
374
+ - typer=0.7.0=pyhd8ed1ab_0
375
+ - typing-extensions=4.5.0=hd8ed1ab_0
376
+ - typing_extensions=4.5.0=pyha770c72_0
377
+ - tzdata=2022g=h191b570_0
378
+ - unicodedata2=15.0.0=py39hb9d737c_0
379
+ - unidecode=1.3.6=pyhd8ed1ab_0
380
+ - urllib3=1.26.15=pyhd8ed1ab_0
381
+ - wasabi=1.1.1=py39hf3d152e_1
382
+ - wcwidth=0.2.6=pyhd8ed1ab_0
383
+ - webencodings=0.5.1=py_1
384
+ - websocket-client=1.5.1=pyhd8ed1ab_0
385
+ - werkzeug=2.2.3=pyhd8ed1ab_0
386
+ - wheel=0.40.0=pyhd8ed1ab_0
387
+ - widgetsnbextension=3.6.1=pyha770c72_0
388
+ - wrapt=1.15.0=py39h72bdee0_0
389
+ - x264=1!164.3095=h166bdaf_2
390
+ - x265=3.5=h924138e_3
391
+ - xcb-util=0.4.0=h166bdaf_0
392
+ - xcb-util-image=0.4.0=h166bdaf_0
393
+ - xcb-util-keysyms=0.4.0=h166bdaf_0
394
+ - xcb-util-renderutil=0.3.9=h166bdaf_0
395
+ - xcb-util-wm=0.4.1=h166bdaf_0
396
+ - xkeyboard-config=2.38=h0b41bf4_0
397
+ - xorg-fixesproto=5.0=h7f98852_1002
398
+ - xorg-inputproto=2.3.2=h7f98852_1002
399
+ - xorg-kbproto=1.0.7=h7f98852_1002
400
+ - xorg-libice=1.0.10=h7f98852_0
401
+ - xorg-libsm=1.2.3=hd9c2040_1000
402
+ - xorg-libx11=1.8.4=h0b41bf4_0
403
+ - xorg-libxau=1.0.9=h7f98852_0
404
+ - xorg-libxdmcp=1.1.3=h7f98852_0
405
+ - xorg-libxext=1.3.4=h0b41bf4_2
406
+ - xorg-libxfixes=5.0.3=h7f98852_1004
407
+ - xorg-libxi=1.7.10=h7f98852_0
408
+ - xorg-libxrender=0.9.10=h7f98852_1003
409
+ - xorg-renderproto=0.11.1=h7f98852_1002
410
+ - xorg-xextproto=7.3.0=h0b41bf4_1003
411
+ - xorg-xproto=7.0.31=h7f98852_1007
412
+ - xz=5.2.6=h166bdaf_0
413
+ - yaml=0.2.5=h7f98852_2
414
+ - yarl=1.8.2=py39hb9d737c_0
415
+ - zeromq=4.3.4=h9c3ff4c_1
416
+ - zict=2.2.0=pyhd8ed1ab_0
417
+ - zipp=3.15.0=pyhd8ed1ab_0
418
+ - zlib=1.2.13=h166bdaf_4
419
+ - zstd=1.5.2=h3eb15da_6
420
+ - pip:
421
+ - accelerate==0.20.0.dev0
422
+ - aiofiles==23.1.0
423
+ - altair==5.0.1
424
+ - appdirs==1.4.4
425
+ - asn1crypto==1.5.1
426
+ - bitsandbytes==0.39.0
427
+ - charset-normalizer==2.0.12
428
+ - cmake==3.26.3
429
+ - cryptography==36.0.2
430
+ - dask-saturn==0.4.3
431
+ - datasets==2.12.0
432
+ - dill==0.3.6
433
+ - docker-pycreds==0.4.0
434
+ - fastapi==0.95.2
435
+ - ffmpy==0.3.0
436
+ - filelock==3.12.0
437
+ - fire==0.5.0
438
+ - gitdb==4.0.10
439
+ - gitpython==3.1.31
440
+ - gradio==3.32.0
441
+ - gradio-client==0.2.5
442
+ - h11==0.14.0
443
+ - httpcore==0.17.2
444
+ - httpx==0.24.1
445
+ - huggingface-hub==0.14.1
446
+ - linkify-it-py==2.0.2
447
+ - lit==16.0.5
448
+ - markdown-it-py==2.2.0
449
+ - mdit-py-plugins==0.3.3
450
+ - mdurl==0.1.2
451
+ - mpmath==1.3.0
452
+ - multiprocess==0.70.14
453
+ - networkx==3.1
454
+ - nvidia-cublas-cu11==11.10.3.66
455
+ - nvidia-cuda-cupti-cu11==11.7.101
456
+ - nvidia-cuda-nvrtc-cu11==11.7.99
457
+ - nvidia-cuda-runtime-cu11==11.7.99
458
+ - nvidia-cudnn-cu11==8.5.0.96
459
+ - nvidia-cufft-cu11==10.9.0.58
460
+ - nvidia-curand-cu11==10.2.10.91
461
+ - nvidia-cusolver-cu11==11.4.0.1
462
+ - nvidia-cusparse-cu11==11.7.4.91
463
+ - nvidia-nccl-cu11==2.14.3
464
+ - nvidia-nvtx-cu11==11.7.91
465
+ - orjson==3.8.14
466
+ - oscrypto==1.3.0
467
+ - pathtools==0.1.2
468
+ - peft==0.4.0.dev0
469
+ - prefect-saturn==0.6.0
470
+ - protobuf==3.20.0
471
+ - pyarrow==12.0.0
472
+ - pycryptodomex==3.17
473
+ - pydub==0.25.1
474
+ - pyopenssl==21.0.0
475
+ - python-multipart==0.0.6
476
+ - regex==2023.5.5
477
+ - responses==0.18.0
478
+ - safetensors==0.3.1
479
+ - semantic-version==2.10.0
480
+ - sentencepiece==0.1.99
481
+ - sentry-sdk==1.24.0
482
+ - setproctitle==1.3.2
483
+ - smmap==5.0.0
484
+ - snowflake-connector-python==2.7.7
485
+ - starlette==0.27.0
486
+ - sympy==1.12
487
+ - termcolor==2.3.0
488
+ - tokenizers==0.13.3
489
+ - torch==2.0.1
490
+ - transformers==4.30.0.dev0
491
+ - triton==2.0.0
492
+ - uc-micro-py==1.0.2
493
+ - uvicorn==0.22.0
494
+ - wandb==0.15.3
495
+ - websockets==11.0.3
496
+ - xxhash==3.2.0
497
+ prefix: /opt/saturncloud/envs/saturn
wandb/run-20230531_164935-4dg4abji/files/config.yaml ADDED
@@ -0,0 +1,588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wandb_version: 1
2
+
3
+ _wandb:
4
+ desc: null
5
+ value:
6
+ python_version: 3.9.15
7
+ cli_version: 0.15.3
8
+ framework: huggingface
9
+ huggingface_version: 4.30.0.dev0
10
+ is_jupyter_run: false
11
+ is_kaggle_kernel: false
12
+ start_time: 1685551775.453024
13
+ t:
14
+ 1:
15
+ - 1
16
+ - 5
17
+ - 11
18
+ - 49
19
+ - 51
20
+ - 53
21
+ - 55
22
+ - 71
23
+ 2:
24
+ - 1
25
+ - 5
26
+ - 11
27
+ - 49
28
+ - 51
29
+ - 53
30
+ - 55
31
+ - 71
32
+ 3:
33
+ - 7
34
+ - 23
35
+ 4: 3.9.15
36
+ 5: 0.15.3
37
+ 6: 4.30.0.dev0
38
+ 8:
39
+ - 5
40
+ m:
41
+ - 1: train/global_step
42
+ 6:
43
+ - 3
44
+ vocab_size:
45
+ desc: null
46
+ value: 32001
47
+ max_position_embeddings:
48
+ desc: null
49
+ value: 2048
50
+ hidden_size:
51
+ desc: null
52
+ value: 3200
53
+ intermediate_size:
54
+ desc: null
55
+ value: 8640
56
+ num_hidden_layers:
57
+ desc: null
58
+ value: 26
59
+ num_attention_heads:
60
+ desc: null
61
+ value: 32
62
+ hidden_act:
63
+ desc: null
64
+ value: silu
65
+ initializer_range:
66
+ desc: null
67
+ value: 0.02
68
+ rms_norm_eps:
69
+ desc: null
70
+ value: 1.0e-06
71
+ use_cache:
72
+ desc: null
73
+ value: false
74
+ return_dict:
75
+ desc: null
76
+ value: true
77
+ output_hidden_states:
78
+ desc: null
79
+ value: false
80
+ output_attentions:
81
+ desc: null
82
+ value: false
83
+ torchscript:
84
+ desc: null
85
+ value: false
86
+ torch_dtype:
87
+ desc: null
88
+ value: float16
89
+ use_bfloat16:
90
+ desc: null
91
+ value: false
92
+ tf_legacy_loss:
93
+ desc: null
94
+ value: false
95
+ pruned_heads:
96
+ desc: null
97
+ value: {}
98
+ tie_word_embeddings:
99
+ desc: null
100
+ value: false
101
+ is_encoder_decoder:
102
+ desc: null
103
+ value: false
104
+ is_decoder:
105
+ desc: null
106
+ value: false
107
+ cross_attention_hidden_size:
108
+ desc: null
109
+ value: null
110
+ add_cross_attention:
111
+ desc: null
112
+ value: false
113
+ tie_encoder_decoder:
114
+ desc: null
115
+ value: false
116
+ max_length:
117
+ desc: null
118
+ value: 20
119
+ min_length:
120
+ desc: null
121
+ value: 0
122
+ do_sample:
123
+ desc: null
124
+ value: false
125
+ early_stopping:
126
+ desc: null
127
+ value: false
128
+ num_beams:
129
+ desc: null
130
+ value: 1
131
+ num_beam_groups:
132
+ desc: null
133
+ value: 1
134
+ diversity_penalty:
135
+ desc: null
136
+ value: 0.0
137
+ temperature:
138
+ desc: null
139
+ value: 1.0
140
+ top_k:
141
+ desc: null
142
+ value: 50
143
+ top_p:
144
+ desc: null
145
+ value: 1.0
146
+ typical_p:
147
+ desc: null
148
+ value: 1.0
149
+ repetition_penalty:
150
+ desc: null
151
+ value: 1.0
152
+ length_penalty:
153
+ desc: null
154
+ value: 1.0
155
+ no_repeat_ngram_size:
156
+ desc: null
157
+ value: 0
158
+ encoder_no_repeat_ngram_size:
159
+ desc: null
160
+ value: 0
161
+ bad_words_ids:
162
+ desc: null
163
+ value: null
164
+ num_return_sequences:
165
+ desc: null
166
+ value: 1
167
+ chunk_size_feed_forward:
168
+ desc: null
169
+ value: 0
170
+ output_scores:
171
+ desc: null
172
+ value: false
173
+ return_dict_in_generate:
174
+ desc: null
175
+ value: false
176
+ forced_bos_token_id:
177
+ desc: null
178
+ value: null
179
+ forced_eos_token_id:
180
+ desc: null
181
+ value: null
182
+ remove_invalid_values:
183
+ desc: null
184
+ value: false
185
+ exponential_decay_length_penalty:
186
+ desc: null
187
+ value: null
188
+ suppress_tokens:
189
+ desc: null
190
+ value: null
191
+ begin_suppress_tokens:
192
+ desc: null
193
+ value: null
194
+ architectures:
195
+ desc: null
196
+ value:
197
+ - LlamaForCausalLM
198
+ finetuning_task:
199
+ desc: null
200
+ value: null
201
+ id2label:
202
+ desc: null
203
+ value:
204
+ '0': LABEL_0
205
+ '1': LABEL_1
206
+ label2id:
207
+ desc: null
208
+ value:
209
+ LABEL_0: 0
210
+ LABEL_1: 1
211
+ tokenizer_class:
212
+ desc: null
213
+ value: null
214
+ prefix:
215
+ desc: null
216
+ value: null
217
+ bos_token_id:
218
+ desc: null
219
+ value: 1
220
+ pad_token_id:
221
+ desc: null
222
+ value: 0
223
+ eos_token_id:
224
+ desc: null
225
+ value: 2
226
+ sep_token_id:
227
+ desc: null
228
+ value: null
229
+ decoder_start_token_id:
230
+ desc: null
231
+ value: null
232
+ task_specific_params:
233
+ desc: null
234
+ value: null
235
+ problem_type:
236
+ desc: null
237
+ value: null
238
+ _name_or_path:
239
+ desc: null
240
+ value: openlm-research/open_llama_3b_600bt_preview
241
+ transformers_version:
242
+ desc: null
243
+ value: 4.30.0.dev0
244
+ model_type:
245
+ desc: null
246
+ value: llama
247
+ quantization_config:
248
+ desc: null
249
+ value:
250
+ load_in_8bit: false
251
+ load_in_4bit: true
252
+ llm_int8_threshold: 6.0
253
+ llm_int8_skip_modules: null
254
+ llm_int8_enable_fp32_cpu_offload: false
255
+ llm_int8_has_fp16_weight: false
256
+ bnb_4bit_quant_type: nf4
257
+ bnb_4bit_use_double_quant: true
258
+ bnb_4bit_compute_dtype: bfloat16
259
+ output_dir:
260
+ desc: null
261
+ value: ./dolly-lora-3b
262
+ overwrite_output_dir:
263
+ desc: null
264
+ value: false
265
+ do_train:
266
+ desc: null
267
+ value: false
268
+ do_eval:
269
+ desc: null
270
+ value: true
271
+ do_predict:
272
+ desc: null
273
+ value: false
274
+ evaluation_strategy:
275
+ desc: null
276
+ value: steps
277
+ prediction_loss_only:
278
+ desc: null
279
+ value: false
280
+ per_device_train_batch_size:
281
+ desc: null
282
+ value: 4
283
+ per_device_eval_batch_size:
284
+ desc: null
285
+ value: 8
286
+ per_gpu_train_batch_size:
287
+ desc: null
288
+ value: None
289
+ per_gpu_eval_batch_size:
290
+ desc: null
291
+ value: None
292
+ gradient_accumulation_steps:
293
+ desc: null
294
+ value: 32
295
+ eval_accumulation_steps:
296
+ desc: null
297
+ value: None
298
+ eval_delay:
299
+ desc: null
300
+ value: 0
301
+ learning_rate:
302
+ desc: null
303
+ value: 0.0003
304
+ weight_decay:
305
+ desc: null
306
+ value: 0.0
307
+ adam_beta1:
308
+ desc: null
309
+ value: 0.9
310
+ adam_beta2:
311
+ desc: null
312
+ value: 0.999
313
+ adam_epsilon:
314
+ desc: null
315
+ value: 1.0e-08
316
+ max_grad_norm:
317
+ desc: null
318
+ value: 1.0
319
+ num_train_epochs:
320
+ desc: null
321
+ value: 3
322
+ max_steps:
323
+ desc: null
324
+ value: -1
325
+ lr_scheduler_type:
326
+ desc: null
327
+ value: linear
328
+ warmup_ratio:
329
+ desc: null
330
+ value: 0.0
331
+ warmup_steps:
332
+ desc: null
333
+ value: 100
334
+ log_level:
335
+ desc: null
336
+ value: passive
337
+ log_level_replica:
338
+ desc: null
339
+ value: warning
340
+ log_on_each_node:
341
+ desc: null
342
+ value: true
343
+ logging_dir:
344
+ desc: null
345
+ value: ./dolly-lora-3b/runs/May31_16-49-31_w-khoic-qlora-098760734b88449facec48d4db511ae3-54fc475665-pz5rx
346
+ logging_strategy:
347
+ desc: null
348
+ value: steps
349
+ logging_first_step:
350
+ desc: null
351
+ value: false
352
+ logging_steps:
353
+ desc: null
354
+ value: 10
355
+ logging_nan_inf_filter:
356
+ desc: null
357
+ value: true
358
+ save_strategy:
359
+ desc: null
360
+ value: steps
361
+ save_steps:
362
+ desc: null
363
+ value: 100
364
+ save_total_limit:
365
+ desc: null
366
+ value: 3
367
+ save_safetensors:
368
+ desc: null
369
+ value: false
370
+ save_on_each_node:
371
+ desc: null
372
+ value: false
373
+ no_cuda:
374
+ desc: null
375
+ value: false
376
+ use_mps_device:
377
+ desc: null
378
+ value: false
379
+ seed:
380
+ desc: null
381
+ value: 42
382
+ data_seed:
383
+ desc: null
384
+ value: None
385
+ jit_mode_eval:
386
+ desc: null
387
+ value: false
388
+ use_ipex:
389
+ desc: null
390
+ value: false
391
+ bf16:
392
+ desc: null
393
+ value: false
394
+ fp16:
395
+ desc: null
396
+ value: false
397
+ fp16_opt_level:
398
+ desc: null
399
+ value: O1
400
+ half_precision_backend:
401
+ desc: null
402
+ value: auto
403
+ bf16_full_eval:
404
+ desc: null
405
+ value: false
406
+ fp16_full_eval:
407
+ desc: null
408
+ value: false
409
+ tf32:
410
+ desc: null
411
+ value: None
412
+ local_rank:
413
+ desc: null
414
+ value: 0
415
+ ddp_backend:
416
+ desc: null
417
+ value: None
418
+ tpu_num_cores:
419
+ desc: null
420
+ value: None
421
+ tpu_metrics_debug:
422
+ desc: null
423
+ value: false
424
+ debug:
425
+ desc: null
426
+ value: '[]'
427
+ dataloader_drop_last:
428
+ desc: null
429
+ value: false
430
+ eval_steps:
431
+ desc: null
432
+ value: 100
433
+ dataloader_num_workers:
434
+ desc: null
435
+ value: 0
436
+ past_index:
437
+ desc: null
438
+ value: -1
439
+ run_name:
440
+ desc: null
441
+ value: ./dolly-lora-3b
442
+ disable_tqdm:
443
+ desc: null
444
+ value: false
445
+ remove_unused_columns:
446
+ desc: null
447
+ value: true
448
+ label_names:
449
+ desc: null
450
+ value: None
451
+ load_best_model_at_end:
452
+ desc: null
453
+ value: false
454
+ metric_for_best_model:
455
+ desc: null
456
+ value: None
457
+ greater_is_better:
458
+ desc: null
459
+ value: None
460
+ ignore_data_skip:
461
+ desc: null
462
+ value: false
463
+ sharded_ddp:
464
+ desc: null
465
+ value: '[]'
466
+ fsdp:
467
+ desc: null
468
+ value: '[]'
469
+ fsdp_min_num_params:
470
+ desc: null
471
+ value: 0
472
+ fsdp_config:
473
+ desc: null
474
+ value: '{''fsdp_min_num_params'': 0, ''xla'': False, ''xla_fsdp_grad_ckpt'': False}'
475
+ fsdp_transformer_layer_cls_to_wrap:
476
+ desc: null
477
+ value: None
478
+ deepspeed:
479
+ desc: null
480
+ value: None
481
+ label_smoothing_factor:
482
+ desc: null
483
+ value: 0.0
484
+ optim:
485
+ desc: null
486
+ value: paged_adamw_8bit
487
+ optim_args:
488
+ desc: null
489
+ value: None
490
+ adafactor:
491
+ desc: null
492
+ value: false
493
+ group_by_length:
494
+ desc: null
495
+ value: true
496
+ length_column_name:
497
+ desc: null
498
+ value: length
499
+ report_to:
500
+ desc: null
501
+ value: '[''tensorboard'', ''wandb'']'
502
+ ddp_find_unused_parameters:
503
+ desc: null
504
+ value: None
505
+ ddp_bucket_cap_mb:
506
+ desc: null
507
+ value: None
508
+ dataloader_pin_memory:
509
+ desc: null
510
+ value: true
511
+ skip_memory_metrics:
512
+ desc: null
513
+ value: true
514
+ use_legacy_prediction_loop:
515
+ desc: null
516
+ value: false
517
+ push_to_hub:
518
+ desc: null
519
+ value: false
520
+ resume_from_checkpoint:
521
+ desc: null
522
+ value: None
523
+ hub_model_id:
524
+ desc: null
525
+ value: None
526
+ hub_strategy:
527
+ desc: null
528
+ value: every_save
529
+ hub_token:
530
+ desc: null
531
+ value: <HUB_TOKEN>
532
+ hub_private_repo:
533
+ desc: null
534
+ value: false
535
+ gradient_checkpointing:
536
+ desc: null
537
+ value: false
538
+ include_inputs_for_metrics:
539
+ desc: null
540
+ value: false
541
+ fp16_backend:
542
+ desc: null
543
+ value: auto
544
+ push_to_hub_model_id:
545
+ desc: null
546
+ value: None
547
+ push_to_hub_organization:
548
+ desc: null
549
+ value: None
550
+ push_to_hub_token:
551
+ desc: null
552
+ value: <PUSH_TO_HUB_TOKEN>
553
+ mp_parameters:
554
+ desc: null
555
+ value: ''
556
+ auto_find_batch_size:
557
+ desc: null
558
+ value: false
559
+ full_determinism:
560
+ desc: null
561
+ value: false
562
+ torchdynamo:
563
+ desc: null
564
+ value: None
565
+ ray_scope:
566
+ desc: null
567
+ value: last
568
+ ddp_timeout:
569
+ desc: null
570
+ value: 1800
571
+ torch_compile:
572
+ desc: null
573
+ value: false
574
+ torch_compile_backend:
575
+ desc: null
576
+ value: None
577
+ torch_compile_mode:
578
+ desc: null
579
+ value: None
580
+ xpu_backend:
581
+ desc: null
582
+ value: None
583
+ train_batch_size:
584
+ desc: null
585
+ value: 4
586
+ eval_batch_size:
587
+ desc: null
588
+ value: 8
wandb/run-20230531_164935-4dg4abji/files/output.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+
2
+ 0%| | 0/222 [00:00<?, ?it/s]You're using a LlamaTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.