WilliamSotoM commited on
Commit
cef1084
·
verified ·
1 Parent(s): 0e183eb

Upload 4 files

Browse files
Files changed (4) hide show
  1. LICENSE +9 -0
  2. README.md +70 -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,70 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - multilingual
4
+ - ast
5
+ - nl
6
+ - en
7
+ - fr
8
+ - de
9
+ - ht
10
+ - it
11
+ - li
12
+ - lb
13
+ - scn
14
+ - es
15
+ - tpi
16
+ license: mit
17
+ tags:
18
+ - text2text-generation
19
+ - text-generation
20
+ base_model: google/mt5-large
21
+ ---
22
+
23
+ # PTHQL_level0_Indo_European
24
+
25
+ This is the Level 0 Indo European 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.
26
+
27
+ # Use
28
+
29
+ This model is the Level 0 of 4 hierarquical LoRAs. It is strongly adviseable to load all 4 LoRAs in order.
30
+
31
+ The following is minimal code to generate English text from an AMR graph:
32
+ ```
33
+ from transformers import MT5ForConditionalGeneration, AutoTokenizer
34
+ from peft import PeftModel
35
+
36
+ model = MT5ForConditionalGeneration.from_pretrained('google/mt5-large')
37
+ tokennizer = AutoTokenizer.from_pretrained('google/mt5-large')
38
+
39
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level0_Indo_European')
40
+ model = model.merge_and_unload()
41
+
42
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level1_Germanic')
43
+ model = model.merge_and_unload()
44
+
45
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_level2_North_Sea_Germanic')
46
+ model = model.merge_and_unload()
47
+
48
+ model = PeftModel.from_pretrained(model, 'WilliamSotoM/PTHQL_language_English')
49
+ model = model.merge_and_unload()
50
+
51
+ graph = '''
52
+ (w / want-01
53
+ :ARG0 (b / boy)
54
+ :ARG1 (b2 / believe-01
55
+ :ARG0 (g / girl)
56
+ :ARG1 b))
57
+ '''
58
+ tokenized_input = tokenizer(graph, return_tensors='pt')
59
+
60
+ with torch.inference_mode():
61
+ prediction = model.generate(**tokenized_input)
62
+ generated_text = tokenizer.batch_decode(prediction, skip_special_tokens=True)[0]
63
+
64
+ print(f'Generated text:', generated_text)
65
+ ```
66
+
67
+ Expected outpu:
68
+ ```
69
+ The boy wants the girl to believe him.
70
+ ```
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
+ "wo",
23
+ "v",
24
+ "k",
25
+ "o",
26
+ "wi_1",
27
+ "wi_0",
28
+ "q"
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:98a8410728309a7260e118820d761a5350e821734a645264075cff4701af928a
3
+ size 1170534090