npedrazzini commited on
Commit
d439de1
·
verified ·
1 Parent(s): 9d1d6e8

Add pre_1850 LoRA adapter (1 epoch)

Browse files
Files changed (3) hide show
  1. README.md +42 -0
  2. adapter_config.json +44 -0
  3. adapter_model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: TextMachineProject/NewsBERT_1800-1920
3
+ library_name: peft
4
+ tags:
5
+ - lora
6
+ - bert
7
+ - masked-language-modeling
8
+ ---
9
+
10
+ # NewsBERT pre-1850 LoRA adapter (1 epoch)
11
+
12
+ A LoRA adapter for [TextMachineProject/NewsBERT_1800-1920](https://huggingface.co/TextMachineProject/NewsBERT_1800-1920),
13
+ fine-tuned for one epoch on newspaper text (pre-1850)
14
+ from the [Heritage Made Digital (HMD14)](https://www.bl.uk/collection-guides/heritage-made-digital)
15
+ and [Living with Machines (LwM)](https://livingwithmachines.ac.uk/) collections.
16
+
17
+ ## Training details
18
+
19
+ - **Period**: pre-1850
20
+ - **Base model**: `TextMachineProject/NewsBERT_1800-1920`
21
+ - **Method**: LoRA (PEFT), target modules: `query`, `value`, `word_embeddings`
22
+ - **LoRA rank**: 16, alpha: 32, dropout: 0.05
23
+ - **Task**: Masked Language Modelling (15% masking probability)
24
+ - **Sequence length**: 128 tokens (sliding window, stride 96)
25
+ - **Epochs**: 1
26
+ - **Batch size**: 256
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ from transformers import AutoTokenizer, AutoModelForMaskedLM
32
+ from peft import PeftModel
33
+
34
+ base = AutoModelForMaskedLM.from_pretrained("TextMachineProject/NewsBERT_1800-1920")
35
+ tokenizer = AutoTokenizer.from_pretrained("TextMachineProject/NewsBERT_1800-1920")
36
+ model = PeftModel.from_pretrained(base, "TextMachineProject/NewsBERT_pre_1850_lora_1epoch")
37
+ ```
38
+
39
+ ## Notes
40
+
41
+ This is a 1-epoch checkpoint uploaded for evaluation purposes. Further training
42
+ is ongoing; updated adapters will be released separately.
adapter_config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "TextMachineProject/NewsBERT_1800-1920",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 16,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "value",
34
+ "word_embeddings",
35
+ "query"
36
+ ],
37
+ "target_parameters": null,
38
+ "task_type": "FEATURE_EXTRACTION",
39
+ "trainable_token_indices": null,
40
+ "use_bdlora": null,
41
+ "use_dora": false,
42
+ "use_qalora": false,
43
+ "use_rslora": false
44
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8447adc4c704eadfe3b654207ee5718f18f39647e2c68dc69b3383b6faac0b25
3
+ size 4368936