WilliamSotoM commited on
Commit
6fcd2b7
·
verified ·
1 Parent(s): 7d9e447

Upload 4 files

Browse files
Files changed (4) hide show
  1. LICENSE +9 -0
  2. README.md +60 -3
  3. adapter_config.json +32 -0
  4. adapter_model.bin +3 -0
LICENSE ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2025
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
README.md CHANGED
@@ -1,3 +1,60 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - multilingual
4
+ - de
5
+ - lb
6
+ license: mit
7
+ tags:
8
+ - text2text-generation
9
+ - text-generation
10
+ base_model: google/mt5-large
11
+ ---
12
+
13
+ # PTHQL_level2_High_German
14
+
15
+ This is the Level 2 High German Phylogenetic Tree Hierarquical QLoRAs (PTHQL) adapter from [Semantic Evaluation of Multilingual Data-to-Text Generation via NLI Fine-Tuning: Precision, Recall and F1 scoresadapters from [Generating from AMRs into High and Low-Resource Languages using Phylogenetic Knowledge and Hierarchical QLoRA Training (HQL)](https://aclanthology.org/2024.inlg-main.7/) used for AMR-to-Text generation.
16
+
17
+ # Use
18
+
19
+ This model is the Level 2 of 4 hierarquical LoRAs. It is strongly adviseable to load all 4 LoRAs in order.
20
+
21
+ The following is minimal code to generate German text from an AMR graph:
22
+ ```
23
+ from transformers import MT5ForConditionalGeneration, AutoTokenizer
24
+ from peft import PeftModel
25
+
26
+ model = MT5ForConditionalGeneration.from_pretrained('google/mt5-large')
27
+ tokennizer = AutoTokenizer.from_pretrained('google/mt5-large')
28
+
29
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level0_Indo_European')
30
+ model = model.merge_and_unload()
31
+
32
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level1_Germanic')
33
+ model = model.merge_and_unload()
34
+
35
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level2_High_German')
36
+ model = model.merge_and_unload()
37
+
38
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_language_German')
39
+ model = model.merge_and_unload()
40
+
41
+ graph = '''
42
+ (w / want-01
43
+ :ARG0 (b / boy)
44
+ :ARG1 (b2 / believe-01
45
+ :ARG0 (g / girl)
46
+ :ARG1 b))
47
+ '''
48
+ tokenized_input = tokenizer(graph, return_tensors='pt')
49
+
50
+ with torch.inference_mode():
51
+ prediction = model.generate(**tokenized_input)
52
+ generated_text = tokenizer.batch_decode(prediction, skip_special_tokens=True)[0]
53
+
54
+ print(f'Generated text:', generated_text)
55
+ ```
56
+
57
+ Expected outpu:
58
+ ```
59
+ De jongen wil dat het meisje hem gelooft.
60
+ ```
adapter_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "google/mt5-large",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "loftq_config": {},
12
+ "lora_alpha": 256,
13
+ "lora_dropout": 0.05,
14
+ "megatron_config": null,
15
+ "megatron_core": "megatron.core",
16
+ "modules_to_save": null,
17
+ "peft_type": "LORA",
18
+ "r": 256,
19
+ "rank_pattern": {},
20
+ "revision": null,
21
+ "target_modules": [
22
+ "o",
23
+ "wo",
24
+ "wi_1",
25
+ "k",
26
+ "q",
27
+ "v",
28
+ "wi_0"
29
+ ],
30
+ "task_type": "SEQ_2_SEQ_LM",
31
+ "use_rslora": true
32
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54e4145d3892fc97b85c0f87ec739c9ed6e5555f2388a7c9888cc169fe59b31e
3
+ size 1170534090