KoichiYasuoka
commited on
Commit
·
9235968
1
Parent(s):
ecb3b5a
initial release
Browse files- README.md +32 -0
- config.json +376 -0
- juman.py +49 -0
- maker.py +108 -0
- mecab-jumandic-utf8.zip +3 -0
- pytorch_model-00001-of-00002.bin +3 -0
- pytorch_model-00002-of-00002.bin +3 -0
- pytorch_model.bin.index.json +589 -0
- special_tokens_map.json +51 -0
- tokenizer.json +0 -0
- tokenizer_config.json +41 -0
- ud.py +129 -0
README.md
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- "ja"
|
4 |
+
tags:
|
5 |
+
- "japanese"
|
6 |
+
- "pos"
|
7 |
+
- "dependency-parsing"
|
8 |
+
base_model: KoichiYasuoka/gpt2-xlarge-japanese-juman-upos
|
9 |
+
datasets:
|
10 |
+
- "universal_dependencies"
|
11 |
+
license: "cc-by-sa-4.0"
|
12 |
+
pipeline_tag: "token-classification"
|
13 |
+
widget:
|
14 |
+
- text: "全学年にわたって小学校の国語の教科書に挿し絵が用いられている"
|
15 |
+
---
|
16 |
+
|
17 |
+
# gpt2-xlarge-japanese-juman-ud-causal
|
18 |
+
|
19 |
+
## Model Description
|
20 |
+
|
21 |
+
This is a GPT-2 model pretrained for POS-tagging and dependency-parsing, derived from [gpt2-xlarge-japanese-juman-upos](https://huggingface.co/KoichiYasuoka/gpt2-xlarge-japanese-juman-upos) and [UD_Japanese-GSDLUW](https://github.com/UniversalDependencies/UD_Japanese-GSDLUW).
|
22 |
+
|
23 |
+
## How to Use
|
24 |
+
|
25 |
+
```
|
26 |
+
from transformers import pipeline
|
27 |
+
nlp=pipeline("universal-dependencies","KoichiYasuoka/gpt2-xlarge-japanese-juman-ud-causal",trust_remote_code=True)
|
28 |
+
print(nlp("全学年にわたって小学校の国語の教科書に挿し絵が用いられている"))
|
29 |
+
```
|
30 |
+
|
31 |
+
[fugashi](https://pypi.org/project/fugashi) is required.
|
32 |
+
|
config.json
ADDED
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation_function": "gelu_new",
|
3 |
+
"architectures": [
|
4 |
+
"GPT2ForTokenClassification"
|
5 |
+
],
|
6 |
+
"attn_pdrop": 0.1,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"custom_pipelines": {
|
9 |
+
"upos": {
|
10 |
+
"impl": "ud.BellmanFordTokenClassificationPipeline",
|
11 |
+
"pt": "AutoModelForTokenClassification"
|
12 |
+
},
|
13 |
+
"universal-dependencies": {
|
14 |
+
"impl": "ud.UniversalDependenciesCausalPipeline",
|
15 |
+
"pt": "AutoModelForTokenClassification"
|
16 |
+
}
|
17 |
+
},
|
18 |
+
"embd_pdrop": 0.1,
|
19 |
+
"eos_token_id": 2,
|
20 |
+
"id2label": {
|
21 |
+
"0": "ADJ",
|
22 |
+
"1": "ADJ|l-acl",
|
23 |
+
"2": "ADJ|l-advcl",
|
24 |
+
"3": "ADJ|l-amod",
|
25 |
+
"4": "ADJ|l-ccomp",
|
26 |
+
"5": "ADJ|l-csubj",
|
27 |
+
"6": "ADJ|l-csubj:outer",
|
28 |
+
"7": "ADJ|l-nmod",
|
29 |
+
"8": "ADJ|l-nsubj",
|
30 |
+
"9": "ADJ|l-obj",
|
31 |
+
"10": "ADJ|l-obl",
|
32 |
+
"11": "ADJ|r-acl",
|
33 |
+
"12": "ADJ|r-amod",
|
34 |
+
"13": "ADJ|r-dep",
|
35 |
+
"14": "ADJ|root",
|
36 |
+
"15": "ADP",
|
37 |
+
"16": "ADP|l-case",
|
38 |
+
"17": "ADP|r-case",
|
39 |
+
"18": "ADP|r-fixed",
|
40 |
+
"19": "ADV",
|
41 |
+
"20": "ADV|l-advcl",
|
42 |
+
"21": "ADV|l-advmod",
|
43 |
+
"22": "ADV|l-obj",
|
44 |
+
"23": "ADV|r-dep",
|
45 |
+
"24": "ADV|root",
|
46 |
+
"25": "AUX",
|
47 |
+
"26": "AUX|Polarity=Neg",
|
48 |
+
"27": "AUX|Polarity=Neg|r-aux",
|
49 |
+
"28": "AUX|Polarity=Neg|r-fixed",
|
50 |
+
"29": "AUX|r-aux",
|
51 |
+
"30": "AUX|r-cop",
|
52 |
+
"31": "AUX|r-fixed",
|
53 |
+
"32": "AUX|root",
|
54 |
+
"33": "B-ADJ",
|
55 |
+
"34": "B-ADP",
|
56 |
+
"35": "B-ADV",
|
57 |
+
"36": "B-AUX",
|
58 |
+
"37": "B-AUX|Polarity=Neg",
|
59 |
+
"38": "B-CCONJ",
|
60 |
+
"39": "B-DET",
|
61 |
+
"40": "B-INTJ",
|
62 |
+
"41": "B-NOUN",
|
63 |
+
"42": "B-NOUN|Polarity=Neg",
|
64 |
+
"43": "B-NUM",
|
65 |
+
"44": "B-PART",
|
66 |
+
"45": "B-PRON",
|
67 |
+
"46": "B-PROPN",
|
68 |
+
"47": "B-PUNCT",
|
69 |
+
"48": "B-SCONJ",
|
70 |
+
"49": "B-SYM",
|
71 |
+
"50": "B-VERB",
|
72 |
+
"51": "B-X",
|
73 |
+
"52": "CCONJ",
|
74 |
+
"53": "CCONJ|l-cc",
|
75 |
+
"54": "CCONJ|r-cc",
|
76 |
+
"55": "DET",
|
77 |
+
"56": "DET|l-det",
|
78 |
+
"57": "I-ADJ",
|
79 |
+
"58": "I-ADP",
|
80 |
+
"59": "I-ADV",
|
81 |
+
"60": "I-AUX",
|
82 |
+
"61": "I-AUX|Polarity=Neg",
|
83 |
+
"62": "I-CCONJ",
|
84 |
+
"63": "I-DET",
|
85 |
+
"64": "I-INTJ",
|
86 |
+
"65": "I-NOUN",
|
87 |
+
"66": "I-NOUN|Polarity=Neg",
|
88 |
+
"67": "I-NUM",
|
89 |
+
"68": "I-PART",
|
90 |
+
"69": "I-PRON",
|
91 |
+
"70": "I-PROPN",
|
92 |
+
"71": "I-PUNCT",
|
93 |
+
"72": "I-SCONJ",
|
94 |
+
"73": "I-SYM",
|
95 |
+
"74": "I-VERB",
|
96 |
+
"75": "I-X",
|
97 |
+
"76": "INTJ",
|
98 |
+
"77": "INTJ|l-discourse",
|
99 |
+
"78": "INTJ|r-discourse",
|
100 |
+
"79": "INTJ|root",
|
101 |
+
"80": "NOUN",
|
102 |
+
"81": "NOUN|Polarity=Neg",
|
103 |
+
"82": "NOUN|Polarity=Neg|l-obl",
|
104 |
+
"83": "NOUN|Polarity=Neg|root",
|
105 |
+
"84": "NOUN|l-acl",
|
106 |
+
"85": "NOUN|l-advcl",
|
107 |
+
"86": "NOUN|l-ccomp",
|
108 |
+
"87": "NOUN|l-compound",
|
109 |
+
"88": "NOUN|l-csubj",
|
110 |
+
"89": "NOUN|l-csubj:outer",
|
111 |
+
"90": "NOUN|l-nmod",
|
112 |
+
"91": "NOUN|l-nsubj",
|
113 |
+
"92": "NOUN|l-nsubj:outer",
|
114 |
+
"93": "NOUN|l-obj",
|
115 |
+
"94": "NOUN|l-obl",
|
116 |
+
"95": "NOUN|r-compound",
|
117 |
+
"96": "NOUN|r-nmod",
|
118 |
+
"97": "NOUN|r-nsubj",
|
119 |
+
"98": "NOUN|root",
|
120 |
+
"99": "NUM",
|
121 |
+
"100": "NUM|l-advcl",
|
122 |
+
"101": "NUM|l-compound",
|
123 |
+
"102": "NUM|l-nmod",
|
124 |
+
"103": "NUM|l-nsubj",
|
125 |
+
"104": "NUM|l-nsubj:outer",
|
126 |
+
"105": "NUM|l-nummod",
|
127 |
+
"106": "NUM|l-obj",
|
128 |
+
"107": "NUM|l-obl",
|
129 |
+
"108": "NUM|r-compound",
|
130 |
+
"109": "NUM|root",
|
131 |
+
"110": "PART",
|
132 |
+
"111": "PART|l-mark",
|
133 |
+
"112": "PART|r-mark",
|
134 |
+
"113": "PRON",
|
135 |
+
"114": "PRON|l-acl",
|
136 |
+
"115": "PRON|l-advcl",
|
137 |
+
"116": "PRON|l-nmod",
|
138 |
+
"117": "PRON|l-nsubj",
|
139 |
+
"118": "PRON|l-nsubj:outer",
|
140 |
+
"119": "PRON|l-obj",
|
141 |
+
"120": "PRON|l-obl",
|
142 |
+
"121": "PRON|root",
|
143 |
+
"122": "PROPN",
|
144 |
+
"123": "PROPN|l-acl",
|
145 |
+
"124": "PROPN|l-advcl",
|
146 |
+
"125": "PROPN|l-compound",
|
147 |
+
"126": "PROPN|l-nmod",
|
148 |
+
"127": "PROPN|l-nsubj",
|
149 |
+
"128": "PROPN|l-nsubj:outer",
|
150 |
+
"129": "PROPN|l-obj",
|
151 |
+
"130": "PROPN|l-obl",
|
152 |
+
"131": "PROPN|r-compound",
|
153 |
+
"132": "PROPN|r-nmod",
|
154 |
+
"133": "PROPN|root",
|
155 |
+
"134": "PUNCT",
|
156 |
+
"135": "PUNCT|l-punct",
|
157 |
+
"136": "PUNCT|r-punct",
|
158 |
+
"137": "SCONJ",
|
159 |
+
"138": "SCONJ|l-dep",
|
160 |
+
"139": "SCONJ|r-fixed",
|
161 |
+
"140": "SCONJ|r-mark",
|
162 |
+
"141": "SYM",
|
163 |
+
"142": "SYM|l-compound",
|
164 |
+
"143": "SYM|l-dep",
|
165 |
+
"144": "SYM|l-nmod",
|
166 |
+
"145": "SYM|l-obl",
|
167 |
+
"146": "SYM|r-compound",
|
168 |
+
"147": "SYM|r-dep",
|
169 |
+
"148": "VERB",
|
170 |
+
"149": "VERB|l-acl",
|
171 |
+
"150": "VERB|l-advcl",
|
172 |
+
"151": "VERB|l-ccomp",
|
173 |
+
"152": "VERB|l-compound",
|
174 |
+
"153": "VERB|l-csubj",
|
175 |
+
"154": "VERB|l-csubj:outer",
|
176 |
+
"155": "VERB|l-nmod",
|
177 |
+
"156": "VERB|l-obj",
|
178 |
+
"157": "VERB|l-obl",
|
179 |
+
"158": "VERB|r-acl",
|
180 |
+
"159": "VERB|r-advcl",
|
181 |
+
"160": "VERB|r-compound",
|
182 |
+
"161": "VERB|root",
|
183 |
+
"162": "X",
|
184 |
+
"163": "X|l-nmod",
|
185 |
+
"164": "X|r-dep"
|
186 |
+
},
|
187 |
+
"initializer_range": 0.02,
|
188 |
+
"label2id": {
|
189 |
+
"ADJ": 0,
|
190 |
+
"ADJ|l-acl": 1,
|
191 |
+
"ADJ|l-advcl": 2,
|
192 |
+
"ADJ|l-amod": 3,
|
193 |
+
"ADJ|l-ccomp": 4,
|
194 |
+
"ADJ|l-csubj": 5,
|
195 |
+
"ADJ|l-csubj:outer": 6,
|
196 |
+
"ADJ|l-nmod": 7,
|
197 |
+
"ADJ|l-nsubj": 8,
|
198 |
+
"ADJ|l-obj": 9,
|
199 |
+
"ADJ|l-obl": 10,
|
200 |
+
"ADJ|r-acl": 11,
|
201 |
+
"ADJ|r-amod": 12,
|
202 |
+
"ADJ|r-dep": 13,
|
203 |
+
"ADJ|root": 14,
|
204 |
+
"ADP": 15,
|
205 |
+
"ADP|l-case": 16,
|
206 |
+
"ADP|r-case": 17,
|
207 |
+
"ADP|r-fixed": 18,
|
208 |
+
"ADV": 19,
|
209 |
+
"ADV|l-advcl": 20,
|
210 |
+
"ADV|l-advmod": 21,
|
211 |
+
"ADV|l-obj": 22,
|
212 |
+
"ADV|r-dep": 23,
|
213 |
+
"ADV|root": 24,
|
214 |
+
"AUX": 25,
|
215 |
+
"AUX|Polarity=Neg": 26,
|
216 |
+
"AUX|Polarity=Neg|r-aux": 27,
|
217 |
+
"AUX|Polarity=Neg|r-fixed": 28,
|
218 |
+
"AUX|r-aux": 29,
|
219 |
+
"AUX|r-cop": 30,
|
220 |
+
"AUX|r-fixed": 31,
|
221 |
+
"AUX|root": 32,
|
222 |
+
"B-ADJ": 33,
|
223 |
+
"B-ADP": 34,
|
224 |
+
"B-ADV": 35,
|
225 |
+
"B-AUX": 36,
|
226 |
+
"B-AUX|Polarity=Neg": 37,
|
227 |
+
"B-CCONJ": 38,
|
228 |
+
"B-DET": 39,
|
229 |
+
"B-INTJ": 40,
|
230 |
+
"B-NOUN": 41,
|
231 |
+
"B-NOUN|Polarity=Neg": 42,
|
232 |
+
"B-NUM": 43,
|
233 |
+
"B-PART": 44,
|
234 |
+
"B-PRON": 45,
|
235 |
+
"B-PROPN": 46,
|
236 |
+
"B-PUNCT": 47,
|
237 |
+
"B-SCONJ": 48,
|
238 |
+
"B-SYM": 49,
|
239 |
+
"B-VERB": 50,
|
240 |
+
"B-X": 51,
|
241 |
+
"CCONJ": 52,
|
242 |
+
"CCONJ|l-cc": 53,
|
243 |
+
"CCONJ|r-cc": 54,
|
244 |
+
"DET": 55,
|
245 |
+
"DET|l-det": 56,
|
246 |
+
"I-ADJ": 57,
|
247 |
+
"I-ADP": 58,
|
248 |
+
"I-ADV": 59,
|
249 |
+
"I-AUX": 60,
|
250 |
+
"I-AUX|Polarity=Neg": 61,
|
251 |
+
"I-CCONJ": 62,
|
252 |
+
"I-DET": 63,
|
253 |
+
"I-INTJ": 64,
|
254 |
+
"I-NOUN": 65,
|
255 |
+
"I-NOUN|Polarity=Neg": 66,
|
256 |
+
"I-NUM": 67,
|
257 |
+
"I-PART": 68,
|
258 |
+
"I-PRON": 69,
|
259 |
+
"I-PROPN": 70,
|
260 |
+
"I-PUNCT": 71,
|
261 |
+
"I-SCONJ": 72,
|
262 |
+
"I-SYM": 73,
|
263 |
+
"I-VERB": 74,
|
264 |
+
"I-X": 75,
|
265 |
+
"INTJ": 76,
|
266 |
+
"INTJ|l-discourse": 77,
|
267 |
+
"INTJ|r-discourse": 78,
|
268 |
+
"INTJ|root": 79,
|
269 |
+
"NOUN": 80,
|
270 |
+
"NOUN|Polarity=Neg": 81,
|
271 |
+
"NOUN|Polarity=Neg|l-obl": 82,
|
272 |
+
"NOUN|Polarity=Neg|root": 83,
|
273 |
+
"NOUN|l-acl": 84,
|
274 |
+
"NOUN|l-advcl": 85,
|
275 |
+
"NOUN|l-ccomp": 86,
|
276 |
+
"NOUN|l-compound": 87,
|
277 |
+
"NOUN|l-csubj": 88,
|
278 |
+
"NOUN|l-csubj:outer": 89,
|
279 |
+
"NOUN|l-nmod": 90,
|
280 |
+
"NOUN|l-nsubj": 91,
|
281 |
+
"NOUN|l-nsubj:outer": 92,
|
282 |
+
"NOUN|l-obj": 93,
|
283 |
+
"NOUN|l-obl": 94,
|
284 |
+
"NOUN|r-compound": 95,
|
285 |
+
"NOUN|r-nmod": 96,
|
286 |
+
"NOUN|r-nsubj": 97,
|
287 |
+
"NOUN|root": 98,
|
288 |
+
"NUM": 99,
|
289 |
+
"NUM|l-advcl": 100,
|
290 |
+
"NUM|l-compound": 101,
|
291 |
+
"NUM|l-nmod": 102,
|
292 |
+
"NUM|l-nsubj": 103,
|
293 |
+
"NUM|l-nsubj:outer": 104,
|
294 |
+
"NUM|l-nummod": 105,
|
295 |
+
"NUM|l-obj": 106,
|
296 |
+
"NUM|l-obl": 107,
|
297 |
+
"NUM|r-compound": 108,
|
298 |
+
"NUM|root": 109,
|
299 |
+
"PART": 110,
|
300 |
+
"PART|l-mark": 111,
|
301 |
+
"PART|r-mark": 112,
|
302 |
+
"PRON": 113,
|
303 |
+
"PRON|l-acl": 114,
|
304 |
+
"PRON|l-advcl": 115,
|
305 |
+
"PRON|l-nmod": 116,
|
306 |
+
"PRON|l-nsubj": 117,
|
307 |
+
"PRON|l-nsubj:outer": 118,
|
308 |
+
"PRON|l-obj": 119,
|
309 |
+
"PRON|l-obl": 120,
|
310 |
+
"PRON|root": 121,
|
311 |
+
"PROPN": 122,
|
312 |
+
"PROPN|l-acl": 123,
|
313 |
+
"PROPN|l-advcl": 124,
|
314 |
+
"PROPN|l-compound": 125,
|
315 |
+
"PROPN|l-nmod": 126,
|
316 |
+
"PROPN|l-nsubj": 127,
|
317 |
+
"PROPN|l-nsubj:outer": 128,
|
318 |
+
"PROPN|l-obj": 129,
|
319 |
+
"PROPN|l-obl": 130,
|
320 |
+
"PROPN|r-compound": 131,
|
321 |
+
"PROPN|r-nmod": 132,
|
322 |
+
"PROPN|root": 133,
|
323 |
+
"PUNCT": 134,
|
324 |
+
"PUNCT|l-punct": 135,
|
325 |
+
"PUNCT|r-punct": 136,
|
326 |
+
"SCONJ": 137,
|
327 |
+
"SCONJ|l-dep": 138,
|
328 |
+
"SCONJ|r-fixed": 139,
|
329 |
+
"SCONJ|r-mark": 140,
|
330 |
+
"SYM": 141,
|
331 |
+
"SYM|l-compound": 142,
|
332 |
+
"SYM|l-dep": 143,
|
333 |
+
"SYM|l-nmod": 144,
|
334 |
+
"SYM|l-obl": 145,
|
335 |
+
"SYM|r-compound": 146,
|
336 |
+
"SYM|r-dep": 147,
|
337 |
+
"VERB": 148,
|
338 |
+
"VERB|l-acl": 149,
|
339 |
+
"VERB|l-advcl": 150,
|
340 |
+
"VERB|l-ccomp": 151,
|
341 |
+
"VERB|l-compound": 152,
|
342 |
+
"VERB|l-csubj": 153,
|
343 |
+
"VERB|l-csubj:outer": 154,
|
344 |
+
"VERB|l-nmod": 155,
|
345 |
+
"VERB|l-obj": 156,
|
346 |
+
"VERB|l-obl": 157,
|
347 |
+
"VERB|r-acl": 158,
|
348 |
+
"VERB|r-advcl": 159,
|
349 |
+
"VERB|r-compound": 160,
|
350 |
+
"VERB|root": 161,
|
351 |
+
"X": 162,
|
352 |
+
"X|l-nmod": 163,
|
353 |
+
"X|r-dep": 164
|
354 |
+
},
|
355 |
+
"layer_norm_epsilon": 1e-05,
|
356 |
+
"model_type": "gpt2",
|
357 |
+
"n_embd": 1600,
|
358 |
+
"n_head": 20,
|
359 |
+
"n_inner": null,
|
360 |
+
"n_layer": 48,
|
361 |
+
"n_positions": 1024,
|
362 |
+
"reorder_and_upcast_attn": false,
|
363 |
+
"resid_pdrop": 0.1,
|
364 |
+
"scale_attn_by_inverse_layer_idx": false,
|
365 |
+
"scale_attn_weights": true,
|
366 |
+
"summary_activation": null,
|
367 |
+
"summary_first_dropout": 0.1,
|
368 |
+
"summary_proj_to_labels": true,
|
369 |
+
"summary_type": "cls_index",
|
370 |
+
"summary_use_proj": true,
|
371 |
+
"tokenizer_class": "JumanPreTrainedTokenizerFast",
|
372 |
+
"torch_dtype": "float32",
|
373 |
+
"transformers_version": "4.42.4",
|
374 |
+
"use_cache": true,
|
375 |
+
"vocab_size": 50000
|
376 |
+
}
|
juman.py
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from transformers import PreTrainedTokenizerFast
|
3 |
+
from transformers.models.bert_japanese.tokenization_bert_japanese import MecabTokenizer
|
4 |
+
try:
|
5 |
+
from transformers.utils import cached_file
|
6 |
+
except:
|
7 |
+
from transformers.file_utils import cached_path,hf_bucket_url
|
8 |
+
cached_file=lambda x,y:os.path.join(x,y) if os.path.isdir(x) else cached_path(hf_bucket_url(x,y))
|
9 |
+
|
10 |
+
class MecabPreTokenizer(MecabTokenizer):
|
11 |
+
def mecab_split(self,i,normalized_string):
|
12 |
+
t=str(normalized_string)
|
13 |
+
z=[]
|
14 |
+
e=0
|
15 |
+
for c in self.tokenize(t):
|
16 |
+
s=t.find(c,e)
|
17 |
+
e=e if s<0 else s+len(c)
|
18 |
+
z.append((0,0) if s<0 else (s,e))
|
19 |
+
return [normalized_string[s:e] for s,e in z if e>0]
|
20 |
+
def pre_tokenize(self,pretok):
|
21 |
+
pretok.split(self.mecab_split)
|
22 |
+
|
23 |
+
class JumanPreTrainedTokenizerFast(PreTrainedTokenizerFast):
|
24 |
+
def __init__(self,**kwargs):
|
25 |
+
from tokenizers.pre_tokenizers import PreTokenizer,Whitespace,Sequence
|
26 |
+
super().__init__(**kwargs)
|
27 |
+
d,r="/var/lib/mecab/dic/juman-utf8","/etc/mecabrc"
|
28 |
+
if not (os.path.isdir(d) and os.path.isfile(r)):
|
29 |
+
import zipfile
|
30 |
+
import tempfile
|
31 |
+
self.dicdir=tempfile.TemporaryDirectory()
|
32 |
+
d=self.dicdir.name
|
33 |
+
with zipfile.ZipFile(cached_file(self.name_or_path,"mecab-jumandic-utf8.zip")) as z:
|
34 |
+
z.extractall(d)
|
35 |
+
r=os.path.join(d,"mecabrc")
|
36 |
+
with open(r,"w",encoding="utf-8") as w:
|
37 |
+
print("dicdir =",d,file=w)
|
38 |
+
self.custom_pre_tokenizer=Sequence([PreTokenizer.custom(MecabPreTokenizer(mecab_dic=None,mecab_option="-d "+d+" -r "+r)),Whitespace()])
|
39 |
+
self._tokenizer.pre_tokenizer=self.custom_pre_tokenizer
|
40 |
+
def save_pretrained(self,save_directory,**kwargs):
|
41 |
+
import shutil
|
42 |
+
from tokenizers.pre_tokenizers import Whitespace
|
43 |
+
self._auto_map={"AutoTokenizer":[None,"juman.JumanPreTrainedTokenizerFast"]}
|
44 |
+
self._tokenizer.pre_tokenizer=Whitespace()
|
45 |
+
super().save_pretrained(save_directory,**kwargs)
|
46 |
+
self._tokenizer.pre_tokenizer=self.custom_pre_tokenizer
|
47 |
+
shutil.copy(os.path.abspath(__file__),os.path.join(save_directory,"juman.py"))
|
48 |
+
shutil.copy(cached_file(self.name_or_path,"mecab-jumandic-utf8.zip"),os.path.join(save_directory,"mecab-jumandic-utf8.zip"))
|
49 |
+
|
maker.py
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! /usr/bin/python3
|
2 |
+
src="KoichiYasuoka/gpt2-xlarge-japanese-juman-upos"
|
3 |
+
tgt="KoichiYasuoka/gpt2-xlarge-japanese-juman-ud-causal"
|
4 |
+
url="https://github.com/UniversalDependencies/UD_Japanese-GSDLUW"
|
5 |
+
import os
|
6 |
+
d=os.path.basename(url)
|
7 |
+
os.system("test -d "+d+" || git clone --depth=1 "+url)
|
8 |
+
os.system("for F in train dev test ; do cp "+d+"/*-$F.conllu $F.conllu ; done")
|
9 |
+
class UDCausalDataset(object):
|
10 |
+
def __init__(self,conllu,tokenizer,embeddings=None):
|
11 |
+
self.conllu=open(conllu,"r",encoding="utf-8")
|
12 |
+
self.tokenizer=tokenizer
|
13 |
+
self.embeddings=embeddings
|
14 |
+
self.max_tokens=3
|
15 |
+
self.seeks=[(0,0)]
|
16 |
+
label=set(["SYM"])
|
17 |
+
dep=set()
|
18 |
+
s=self.conllu.readline()
|
19 |
+
while s!="":
|
20 |
+
if s=="\n":
|
21 |
+
self.seeks.append((self.conllu.tell(),0))
|
22 |
+
else:
|
23 |
+
w=s.split("\t")
|
24 |
+
if len(w)==10:
|
25 |
+
if w[0].isdecimal():
|
26 |
+
p=w[3] if w[5]=="_" else w[3]+"|"+w[5]
|
27 |
+
label.add(p)
|
28 |
+
dep.add(p+("|" if w[6]=="0" else "|l-" if int(w[0])<int(w[6]) else "|r-")+w[7])
|
29 |
+
self.seeks.append((self.seeks[-1][0],int(w[0])))
|
30 |
+
self.max_tokens=max(self.max_tokens,int(w[0])*2+1)
|
31 |
+
s=self.conllu.readline()
|
32 |
+
lid={}
|
33 |
+
for i,l in enumerate(sorted(label)):
|
34 |
+
lid[l],lid["B-"+l],lid["I-"+l]=i*3,i*3+1,i*3+2
|
35 |
+
for i,d in enumerate(sorted(dep),len(lid)):
|
36 |
+
lid[d]=i
|
37 |
+
self.label2id=lid
|
38 |
+
def __call__(*args):
|
39 |
+
lid={l:i for i,l in enumerate(sorted(set(sum([list(t.label2id) for t in args],[]))))}
|
40 |
+
for t in args:
|
41 |
+
t.label2id=lid
|
42 |
+
return lid
|
43 |
+
def __del__(self):
|
44 |
+
self.conllu.close()
|
45 |
+
__len__=lambda self:len(self.seeks)-1
|
46 |
+
def __getitem__(self,i):
|
47 |
+
s,t=self.seeks[i]
|
48 |
+
self.conllu.seek(s)
|
49 |
+
form,upos,deps,w=[],[],[],[""]
|
50 |
+
while w[0]!="\n":
|
51 |
+
w=self.conllu.readline().split("\t")
|
52 |
+
if len(w)==10:
|
53 |
+
form.append(w[1])
|
54 |
+
if w[0].isdecimal():
|
55 |
+
upos.append(w[3] if w[5]=="_" else w[3]+"|"+w[5])
|
56 |
+
deps.append((int(w[6]),w[7]))
|
57 |
+
v=self.tokenizer(form,add_special_tokens=False)
|
58 |
+
if t==0:
|
59 |
+
i,u=[],[]
|
60 |
+
for j,(x,y) in enumerate(zip(v["input_ids"],upos)):
|
61 |
+
if x!=[]:
|
62 |
+
i+=x
|
63 |
+
u+=[y] if len(x)==1 else ["B-"+y]+["I-"+y]*(len(x)-1)
|
64 |
+
emb=self.embeddings
|
65 |
+
pad=self.tokenizer.pad_token_id
|
66 |
+
else:
|
67 |
+
import torch
|
68 |
+
m=[]
|
69 |
+
for x in v["input_ids"]:
|
70 |
+
if x==[]:
|
71 |
+
m.append(self.embeddings[self.tokenizer.unk_token_id,:])
|
72 |
+
else:
|
73 |
+
m.append(self.embeddings[x,:].sum(axis=0))
|
74 |
+
m.append(self.embeddings[self.tokenizer.sep_token_id,:])
|
75 |
+
m.append(self.embeddings[self.tokenizer.pad_token_id,:])
|
76 |
+
emb=torch.stack(m)
|
77 |
+
i,u=list(range(len(upos)+1)),upos+["SYM"]
|
78 |
+
i.append(t-1)
|
79 |
+
k,d=deps[t-1]
|
80 |
+
u.append(upos[t-1]+"|"+d if k==0 else upos[t-1])
|
81 |
+
for j in range(t,len(upos)):
|
82 |
+
i.append(j)
|
83 |
+
a,b=deps[j]
|
84 |
+
u.append(upos[j]+"|r-"+b if a==t else upos[t-1]+"|l-"+d if j+1==k else upos[j])
|
85 |
+
pad=-1
|
86 |
+
j=self.max_tokens-len(i)
|
87 |
+
if j>0:
|
88 |
+
ids=i+[pad]*j
|
89 |
+
upos=u+["SYM"]*j
|
90 |
+
else:
|
91 |
+
ids=i[0:self.max_tokens]
|
92 |
+
upos=u[0:self.max_tokens]
|
93 |
+
return {"inputs_embeds":emb[ids,:],"labels":[self.label2id[p] for p in upos]}
|
94 |
+
from transformers import PreTrainedTokenizerFast,AutoConfig,GPT2ForTokenClassification,DefaultDataCollator,TrainingArguments,Trainer
|
95 |
+
tkz=PreTrainedTokenizerFast.from_pretrained(src)
|
96 |
+
trainDS=UDCausalDataset("train.conllu",tkz)
|
97 |
+
devDS=UDCausalDataset("dev.conllu",tkz)
|
98 |
+
testDS=UDCausalDataset("test.conllu",tkz)
|
99 |
+
lid=trainDS(devDS,testDS)
|
100 |
+
cfg=AutoConfig.from_pretrained(src,num_labels=len(lid),label2id=lid,id2label={i:l for l,i in lid.items()},ignore_mismatched_sizes=True)
|
101 |
+
mdl=GPT2ForTokenClassification.from_pretrained(src,config=cfg,ignore_mismatched_sizes=True)
|
102 |
+
trainDS.embeddings=mdl.get_input_embeddings().weight
|
103 |
+
trainDS.max_tokens=min(trainDS.max_tokens,cfg.max_position_embeddings)
|
104 |
+
arg=TrainingArguments(num_train_epochs=3,per_device_train_batch_size=8,dataloader_pin_memory=False,output_dir=tgt,overwrite_output_dir=True,save_total_limit=2,learning_rate=5e-05,warmup_ratio=0.1,save_safetensors=False)
|
105 |
+
trn=Trainer(args=arg,data_collator=DefaultDataCollator(),model=mdl,train_dataset=trainDS)
|
106 |
+
trn.train()
|
107 |
+
trn.save_model(tgt)
|
108 |
+
tkz.save_pretrained(tgt)
|
mecab-jumandic-utf8.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bbde3e53407df0e50122816df8f936ceb006580c17026e21037518ed542e4cbc
|
3 |
+
size 33196897
|
pytorch_model-00001-of-00002.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e91b32708f55f9130527edb80239eb9a502e4c17b7455e8fd01e15c8b9fdbd0
|
3 |
+
size 4999326494
|
pytorch_model-00002-of-00002.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:49160062af89276e74c4179f798ec8db82962e34b0fcf37cf7d966843a09760b
|
3 |
+
size 1230730516
|
pytorch_model.bin.index.json
ADDED
@@ -0,0 +1,589 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 6229856660
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"classifier.bias": "pytorch_model-00002-of-00002.bin",
|
7 |
+
"classifier.weight": "pytorch_model-00002-of-00002.bin",
|
8 |
+
"transformer.h.0.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
9 |
+
"transformer.h.0.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
10 |
+
"transformer.h.0.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
11 |
+
"transformer.h.0.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
12 |
+
"transformer.h.0.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
13 |
+
"transformer.h.0.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
14 |
+
"transformer.h.0.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
15 |
+
"transformer.h.0.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
16 |
+
"transformer.h.0.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
17 |
+
"transformer.h.0.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
18 |
+
"transformer.h.0.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
19 |
+
"transformer.h.0.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
20 |
+
"transformer.h.1.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
21 |
+
"transformer.h.1.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
22 |
+
"transformer.h.1.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
23 |
+
"transformer.h.1.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
24 |
+
"transformer.h.1.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
25 |
+
"transformer.h.1.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
26 |
+
"transformer.h.1.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
27 |
+
"transformer.h.1.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
28 |
+
"transformer.h.1.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
29 |
+
"transformer.h.1.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
30 |
+
"transformer.h.1.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
31 |
+
"transformer.h.1.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
32 |
+
"transformer.h.10.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
33 |
+
"transformer.h.10.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
34 |
+
"transformer.h.10.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
35 |
+
"transformer.h.10.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
36 |
+
"transformer.h.10.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
37 |
+
"transformer.h.10.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
38 |
+
"transformer.h.10.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
39 |
+
"transformer.h.10.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
40 |
+
"transformer.h.10.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
41 |
+
"transformer.h.10.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
42 |
+
"transformer.h.10.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
43 |
+
"transformer.h.10.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
44 |
+
"transformer.h.11.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
45 |
+
"transformer.h.11.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
46 |
+
"transformer.h.11.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
47 |
+
"transformer.h.11.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
48 |
+
"transformer.h.11.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
49 |
+
"transformer.h.11.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
50 |
+
"transformer.h.11.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
51 |
+
"transformer.h.11.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
52 |
+
"transformer.h.11.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
53 |
+
"transformer.h.11.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
54 |
+
"transformer.h.11.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
55 |
+
"transformer.h.11.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
56 |
+
"transformer.h.12.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
57 |
+
"transformer.h.12.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
58 |
+
"transformer.h.12.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
59 |
+
"transformer.h.12.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
60 |
+
"transformer.h.12.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
61 |
+
"transformer.h.12.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
62 |
+
"transformer.h.12.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
63 |
+
"transformer.h.12.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
64 |
+
"transformer.h.12.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
65 |
+
"transformer.h.12.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
66 |
+
"transformer.h.12.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
67 |
+
"transformer.h.12.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
68 |
+
"transformer.h.13.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
69 |
+
"transformer.h.13.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
70 |
+
"transformer.h.13.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
71 |
+
"transformer.h.13.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
72 |
+
"transformer.h.13.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
73 |
+
"transformer.h.13.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
74 |
+
"transformer.h.13.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
75 |
+
"transformer.h.13.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
76 |
+
"transformer.h.13.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
77 |
+
"transformer.h.13.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
78 |
+
"transformer.h.13.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
79 |
+
"transformer.h.13.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
80 |
+
"transformer.h.14.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
81 |
+
"transformer.h.14.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
82 |
+
"transformer.h.14.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
83 |
+
"transformer.h.14.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
84 |
+
"transformer.h.14.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
85 |
+
"transformer.h.14.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
86 |
+
"transformer.h.14.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
87 |
+
"transformer.h.14.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
88 |
+
"transformer.h.14.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
89 |
+
"transformer.h.14.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
90 |
+
"transformer.h.14.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
91 |
+
"transformer.h.14.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
92 |
+
"transformer.h.15.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
93 |
+
"transformer.h.15.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
94 |
+
"transformer.h.15.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
95 |
+
"transformer.h.15.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
96 |
+
"transformer.h.15.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
97 |
+
"transformer.h.15.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
98 |
+
"transformer.h.15.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
99 |
+
"transformer.h.15.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
100 |
+
"transformer.h.15.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
101 |
+
"transformer.h.15.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
102 |
+
"transformer.h.15.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
103 |
+
"transformer.h.15.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
104 |
+
"transformer.h.16.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
105 |
+
"transformer.h.16.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
106 |
+
"transformer.h.16.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
107 |
+
"transformer.h.16.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
108 |
+
"transformer.h.16.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
109 |
+
"transformer.h.16.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
110 |
+
"transformer.h.16.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
111 |
+
"transformer.h.16.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
112 |
+
"transformer.h.16.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
113 |
+
"transformer.h.16.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
114 |
+
"transformer.h.16.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
115 |
+
"transformer.h.16.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
116 |
+
"transformer.h.17.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
117 |
+
"transformer.h.17.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
118 |
+
"transformer.h.17.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
119 |
+
"transformer.h.17.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
120 |
+
"transformer.h.17.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
121 |
+
"transformer.h.17.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
122 |
+
"transformer.h.17.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
123 |
+
"transformer.h.17.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
124 |
+
"transformer.h.17.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
125 |
+
"transformer.h.17.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
126 |
+
"transformer.h.17.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
127 |
+
"transformer.h.17.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
128 |
+
"transformer.h.18.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
129 |
+
"transformer.h.18.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
130 |
+
"transformer.h.18.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
131 |
+
"transformer.h.18.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
132 |
+
"transformer.h.18.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
133 |
+
"transformer.h.18.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
134 |
+
"transformer.h.18.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
135 |
+
"transformer.h.18.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
136 |
+
"transformer.h.18.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
137 |
+
"transformer.h.18.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
138 |
+
"transformer.h.18.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
139 |
+
"transformer.h.18.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
140 |
+
"transformer.h.19.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
141 |
+
"transformer.h.19.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
142 |
+
"transformer.h.19.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
143 |
+
"transformer.h.19.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
144 |
+
"transformer.h.19.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
145 |
+
"transformer.h.19.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
146 |
+
"transformer.h.19.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
147 |
+
"transformer.h.19.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
148 |
+
"transformer.h.19.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
149 |
+
"transformer.h.19.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
150 |
+
"transformer.h.19.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
151 |
+
"transformer.h.19.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
152 |
+
"transformer.h.2.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
153 |
+
"transformer.h.2.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
154 |
+
"transformer.h.2.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
155 |
+
"transformer.h.2.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
156 |
+
"transformer.h.2.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
157 |
+
"transformer.h.2.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
158 |
+
"transformer.h.2.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
159 |
+
"transformer.h.2.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
160 |
+
"transformer.h.2.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
161 |
+
"transformer.h.2.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
162 |
+
"transformer.h.2.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
163 |
+
"transformer.h.2.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
164 |
+
"transformer.h.20.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
165 |
+
"transformer.h.20.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
166 |
+
"transformer.h.20.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
167 |
+
"transformer.h.20.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
168 |
+
"transformer.h.20.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
169 |
+
"transformer.h.20.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
170 |
+
"transformer.h.20.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
171 |
+
"transformer.h.20.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
172 |
+
"transformer.h.20.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
173 |
+
"transformer.h.20.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
174 |
+
"transformer.h.20.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
175 |
+
"transformer.h.20.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
176 |
+
"transformer.h.21.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
177 |
+
"transformer.h.21.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
178 |
+
"transformer.h.21.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
179 |
+
"transformer.h.21.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
180 |
+
"transformer.h.21.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
181 |
+
"transformer.h.21.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
182 |
+
"transformer.h.21.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
183 |
+
"transformer.h.21.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
184 |
+
"transformer.h.21.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
185 |
+
"transformer.h.21.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
186 |
+
"transformer.h.21.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
187 |
+
"transformer.h.21.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
188 |
+
"transformer.h.22.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
189 |
+
"transformer.h.22.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
190 |
+
"transformer.h.22.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
191 |
+
"transformer.h.22.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
192 |
+
"transformer.h.22.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
193 |
+
"transformer.h.22.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
194 |
+
"transformer.h.22.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
195 |
+
"transformer.h.22.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
196 |
+
"transformer.h.22.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
197 |
+
"transformer.h.22.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
198 |
+
"transformer.h.22.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
199 |
+
"transformer.h.22.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
200 |
+
"transformer.h.23.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
201 |
+
"transformer.h.23.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
202 |
+
"transformer.h.23.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
203 |
+
"transformer.h.23.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
204 |
+
"transformer.h.23.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
205 |
+
"transformer.h.23.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
206 |
+
"transformer.h.23.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
207 |
+
"transformer.h.23.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
208 |
+
"transformer.h.23.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
209 |
+
"transformer.h.23.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
210 |
+
"transformer.h.23.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
211 |
+
"transformer.h.23.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
212 |
+
"transformer.h.24.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
213 |
+
"transformer.h.24.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
214 |
+
"transformer.h.24.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
215 |
+
"transformer.h.24.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
216 |
+
"transformer.h.24.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
217 |
+
"transformer.h.24.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
218 |
+
"transformer.h.24.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
219 |
+
"transformer.h.24.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
220 |
+
"transformer.h.24.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
221 |
+
"transformer.h.24.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
222 |
+
"transformer.h.24.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
223 |
+
"transformer.h.24.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
224 |
+
"transformer.h.25.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
225 |
+
"transformer.h.25.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
226 |
+
"transformer.h.25.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
227 |
+
"transformer.h.25.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
228 |
+
"transformer.h.25.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
229 |
+
"transformer.h.25.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
230 |
+
"transformer.h.25.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
231 |
+
"transformer.h.25.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
232 |
+
"transformer.h.25.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
233 |
+
"transformer.h.25.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
234 |
+
"transformer.h.25.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
235 |
+
"transformer.h.25.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
236 |
+
"transformer.h.26.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
237 |
+
"transformer.h.26.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
238 |
+
"transformer.h.26.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
239 |
+
"transformer.h.26.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
240 |
+
"transformer.h.26.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
241 |
+
"transformer.h.26.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
242 |
+
"transformer.h.26.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
243 |
+
"transformer.h.26.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
244 |
+
"transformer.h.26.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
245 |
+
"transformer.h.26.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
246 |
+
"transformer.h.26.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
247 |
+
"transformer.h.26.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
248 |
+
"transformer.h.27.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
249 |
+
"transformer.h.27.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
250 |
+
"transformer.h.27.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
251 |
+
"transformer.h.27.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
252 |
+
"transformer.h.27.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
253 |
+
"transformer.h.27.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
254 |
+
"transformer.h.27.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
255 |
+
"transformer.h.27.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
256 |
+
"transformer.h.27.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
257 |
+
"transformer.h.27.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
258 |
+
"transformer.h.27.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
259 |
+
"transformer.h.27.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
260 |
+
"transformer.h.28.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
261 |
+
"transformer.h.28.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
262 |
+
"transformer.h.28.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
263 |
+
"transformer.h.28.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
264 |
+
"transformer.h.28.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
265 |
+
"transformer.h.28.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
266 |
+
"transformer.h.28.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
267 |
+
"transformer.h.28.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
268 |
+
"transformer.h.28.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
269 |
+
"transformer.h.28.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
270 |
+
"transformer.h.28.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
271 |
+
"transformer.h.28.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
272 |
+
"transformer.h.29.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
273 |
+
"transformer.h.29.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
274 |
+
"transformer.h.29.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
275 |
+
"transformer.h.29.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
276 |
+
"transformer.h.29.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
277 |
+
"transformer.h.29.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
278 |
+
"transformer.h.29.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
279 |
+
"transformer.h.29.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
280 |
+
"transformer.h.29.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
281 |
+
"transformer.h.29.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
282 |
+
"transformer.h.29.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
283 |
+
"transformer.h.29.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
284 |
+
"transformer.h.3.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
285 |
+
"transformer.h.3.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
286 |
+
"transformer.h.3.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
287 |
+
"transformer.h.3.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
288 |
+
"transformer.h.3.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
289 |
+
"transformer.h.3.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
290 |
+
"transformer.h.3.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
291 |
+
"transformer.h.3.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
292 |
+
"transformer.h.3.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
293 |
+
"transformer.h.3.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
294 |
+
"transformer.h.3.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
295 |
+
"transformer.h.3.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
296 |
+
"transformer.h.30.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
297 |
+
"transformer.h.30.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
298 |
+
"transformer.h.30.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
299 |
+
"transformer.h.30.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
300 |
+
"transformer.h.30.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
301 |
+
"transformer.h.30.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
302 |
+
"transformer.h.30.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
303 |
+
"transformer.h.30.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
304 |
+
"transformer.h.30.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
305 |
+
"transformer.h.30.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
306 |
+
"transformer.h.30.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
307 |
+
"transformer.h.30.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
308 |
+
"transformer.h.31.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
309 |
+
"transformer.h.31.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
310 |
+
"transformer.h.31.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
311 |
+
"transformer.h.31.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
312 |
+
"transformer.h.31.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
313 |
+
"transformer.h.31.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
314 |
+
"transformer.h.31.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
315 |
+
"transformer.h.31.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
316 |
+
"transformer.h.31.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
317 |
+
"transformer.h.31.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
318 |
+
"transformer.h.31.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
319 |
+
"transformer.h.31.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
320 |
+
"transformer.h.32.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
321 |
+
"transformer.h.32.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
322 |
+
"transformer.h.32.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
323 |
+
"transformer.h.32.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
324 |
+
"transformer.h.32.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
325 |
+
"transformer.h.32.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
326 |
+
"transformer.h.32.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
327 |
+
"transformer.h.32.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
328 |
+
"transformer.h.32.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
329 |
+
"transformer.h.32.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
330 |
+
"transformer.h.32.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
331 |
+
"transformer.h.32.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
332 |
+
"transformer.h.33.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
333 |
+
"transformer.h.33.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
334 |
+
"transformer.h.33.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
335 |
+
"transformer.h.33.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
336 |
+
"transformer.h.33.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
337 |
+
"transformer.h.33.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
338 |
+
"transformer.h.33.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
339 |
+
"transformer.h.33.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
340 |
+
"transformer.h.33.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
341 |
+
"transformer.h.33.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
342 |
+
"transformer.h.33.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
343 |
+
"transformer.h.33.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
344 |
+
"transformer.h.34.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
345 |
+
"transformer.h.34.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
346 |
+
"transformer.h.34.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
347 |
+
"transformer.h.34.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
348 |
+
"transformer.h.34.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
349 |
+
"transformer.h.34.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
350 |
+
"transformer.h.34.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
351 |
+
"transformer.h.34.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
352 |
+
"transformer.h.34.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
353 |
+
"transformer.h.34.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
354 |
+
"transformer.h.34.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
355 |
+
"transformer.h.34.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
356 |
+
"transformer.h.35.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
357 |
+
"transformer.h.35.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
358 |
+
"transformer.h.35.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
359 |
+
"transformer.h.35.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
360 |
+
"transformer.h.35.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
361 |
+
"transformer.h.35.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
362 |
+
"transformer.h.35.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
363 |
+
"transformer.h.35.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
364 |
+
"transformer.h.35.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
365 |
+
"transformer.h.35.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
366 |
+
"transformer.h.35.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
367 |
+
"transformer.h.35.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
368 |
+
"transformer.h.36.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
369 |
+
"transformer.h.36.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
370 |
+
"transformer.h.36.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
371 |
+
"transformer.h.36.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
372 |
+
"transformer.h.36.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
373 |
+
"transformer.h.36.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
374 |
+
"transformer.h.36.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
375 |
+
"transformer.h.36.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
376 |
+
"transformer.h.36.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
377 |
+
"transformer.h.36.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
378 |
+
"transformer.h.36.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
379 |
+
"transformer.h.36.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
380 |
+
"transformer.h.37.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
381 |
+
"transformer.h.37.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
382 |
+
"transformer.h.37.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
383 |
+
"transformer.h.37.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
384 |
+
"transformer.h.37.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
385 |
+
"transformer.h.37.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
386 |
+
"transformer.h.37.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
387 |
+
"transformer.h.37.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
388 |
+
"transformer.h.37.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
389 |
+
"transformer.h.37.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
390 |
+
"transformer.h.37.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
391 |
+
"transformer.h.37.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
392 |
+
"transformer.h.38.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
393 |
+
"transformer.h.38.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
394 |
+
"transformer.h.38.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
395 |
+
"transformer.h.38.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
396 |
+
"transformer.h.38.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
397 |
+
"transformer.h.38.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
398 |
+
"transformer.h.38.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
399 |
+
"transformer.h.38.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
400 |
+
"transformer.h.38.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
401 |
+
"transformer.h.38.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
402 |
+
"transformer.h.38.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
403 |
+
"transformer.h.38.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
404 |
+
"transformer.h.39.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
405 |
+
"transformer.h.39.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
406 |
+
"transformer.h.39.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
407 |
+
"transformer.h.39.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
408 |
+
"transformer.h.39.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
409 |
+
"transformer.h.39.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
410 |
+
"transformer.h.39.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
411 |
+
"transformer.h.39.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
412 |
+
"transformer.h.39.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
413 |
+
"transformer.h.39.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
414 |
+
"transformer.h.39.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
415 |
+
"transformer.h.39.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
416 |
+
"transformer.h.4.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
417 |
+
"transformer.h.4.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
418 |
+
"transformer.h.4.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
419 |
+
"transformer.h.4.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
420 |
+
"transformer.h.4.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
421 |
+
"transformer.h.4.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
422 |
+
"transformer.h.4.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
423 |
+
"transformer.h.4.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
424 |
+
"transformer.h.4.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
425 |
+
"transformer.h.4.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
426 |
+
"transformer.h.4.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
427 |
+
"transformer.h.4.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
428 |
+
"transformer.h.40.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
429 |
+
"transformer.h.40.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
430 |
+
"transformer.h.40.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
431 |
+
"transformer.h.40.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
432 |
+
"transformer.h.40.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
433 |
+
"transformer.h.40.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
434 |
+
"transformer.h.40.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
435 |
+
"transformer.h.40.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
436 |
+
"transformer.h.40.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
437 |
+
"transformer.h.40.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
438 |
+
"transformer.h.40.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
439 |
+
"transformer.h.40.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
440 |
+
"transformer.h.41.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
441 |
+
"transformer.h.41.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
442 |
+
"transformer.h.41.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
443 |
+
"transformer.h.41.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
444 |
+
"transformer.h.41.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
445 |
+
"transformer.h.41.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
446 |
+
"transformer.h.41.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
447 |
+
"transformer.h.41.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
448 |
+
"transformer.h.41.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
449 |
+
"transformer.h.41.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
450 |
+
"transformer.h.41.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
451 |
+
"transformer.h.41.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
452 |
+
"transformer.h.42.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
453 |
+
"transformer.h.42.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
454 |
+
"transformer.h.42.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
455 |
+
"transformer.h.42.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
456 |
+
"transformer.h.42.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
457 |
+
"transformer.h.42.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
458 |
+
"transformer.h.42.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
459 |
+
"transformer.h.42.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
460 |
+
"transformer.h.42.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
461 |
+
"transformer.h.42.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
462 |
+
"transformer.h.42.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
463 |
+
"transformer.h.42.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
464 |
+
"transformer.h.43.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
465 |
+
"transformer.h.43.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
466 |
+
"transformer.h.43.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
467 |
+
"transformer.h.43.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
468 |
+
"transformer.h.43.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
469 |
+
"transformer.h.43.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
470 |
+
"transformer.h.43.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
471 |
+
"transformer.h.43.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
472 |
+
"transformer.h.43.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
473 |
+
"transformer.h.43.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
474 |
+
"transformer.h.43.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
475 |
+
"transformer.h.43.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
476 |
+
"transformer.h.44.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
477 |
+
"transformer.h.44.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
478 |
+
"transformer.h.44.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
479 |
+
"transformer.h.44.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
480 |
+
"transformer.h.44.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
481 |
+
"transformer.h.44.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
482 |
+
"transformer.h.44.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
483 |
+
"transformer.h.44.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
484 |
+
"transformer.h.44.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
485 |
+
"transformer.h.44.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
486 |
+
"transformer.h.44.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
487 |
+
"transformer.h.44.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
488 |
+
"transformer.h.45.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
489 |
+
"transformer.h.45.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
490 |
+
"transformer.h.45.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
491 |
+
"transformer.h.45.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
492 |
+
"transformer.h.45.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
493 |
+
"transformer.h.45.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
494 |
+
"transformer.h.45.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
495 |
+
"transformer.h.45.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
496 |
+
"transformer.h.45.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
497 |
+
"transformer.h.45.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
498 |
+
"transformer.h.45.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
499 |
+
"transformer.h.45.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
500 |
+
"transformer.h.46.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
501 |
+
"transformer.h.46.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
502 |
+
"transformer.h.46.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
503 |
+
"transformer.h.46.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
504 |
+
"transformer.h.46.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
505 |
+
"transformer.h.46.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
506 |
+
"transformer.h.46.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
507 |
+
"transformer.h.46.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
508 |
+
"transformer.h.46.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
509 |
+
"transformer.h.46.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
510 |
+
"transformer.h.46.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
511 |
+
"transformer.h.46.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
512 |
+
"transformer.h.47.attn.c_attn.bias": "pytorch_model-00002-of-00002.bin",
|
513 |
+
"transformer.h.47.attn.c_attn.weight": "pytorch_model-00002-of-00002.bin",
|
514 |
+
"transformer.h.47.attn.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
515 |
+
"transformer.h.47.attn.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
516 |
+
"transformer.h.47.ln_1.bias": "pytorch_model-00002-of-00002.bin",
|
517 |
+
"transformer.h.47.ln_1.weight": "pytorch_model-00002-of-00002.bin",
|
518 |
+
"transformer.h.47.ln_2.bias": "pytorch_model-00002-of-00002.bin",
|
519 |
+
"transformer.h.47.ln_2.weight": "pytorch_model-00002-of-00002.bin",
|
520 |
+
"transformer.h.47.mlp.c_fc.bias": "pytorch_model-00002-of-00002.bin",
|
521 |
+
"transformer.h.47.mlp.c_fc.weight": "pytorch_model-00002-of-00002.bin",
|
522 |
+
"transformer.h.47.mlp.c_proj.bias": "pytorch_model-00002-of-00002.bin",
|
523 |
+
"transformer.h.47.mlp.c_proj.weight": "pytorch_model-00002-of-00002.bin",
|
524 |
+
"transformer.h.5.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
525 |
+
"transformer.h.5.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
526 |
+
"transformer.h.5.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
527 |
+
"transformer.h.5.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
528 |
+
"transformer.h.5.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
529 |
+
"transformer.h.5.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
530 |
+
"transformer.h.5.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
531 |
+
"transformer.h.5.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
532 |
+
"transformer.h.5.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
533 |
+
"transformer.h.5.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
534 |
+
"transformer.h.5.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
535 |
+
"transformer.h.5.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
536 |
+
"transformer.h.6.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
537 |
+
"transformer.h.6.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
538 |
+
"transformer.h.6.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
539 |
+
"transformer.h.6.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
540 |
+
"transformer.h.6.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
541 |
+
"transformer.h.6.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
542 |
+
"transformer.h.6.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
543 |
+
"transformer.h.6.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
544 |
+
"transformer.h.6.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
545 |
+
"transformer.h.6.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
546 |
+
"transformer.h.6.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
547 |
+
"transformer.h.6.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
548 |
+
"transformer.h.7.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
549 |
+
"transformer.h.7.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
550 |
+
"transformer.h.7.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
551 |
+
"transformer.h.7.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
552 |
+
"transformer.h.7.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
553 |
+
"transformer.h.7.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
554 |
+
"transformer.h.7.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
555 |
+
"transformer.h.7.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
556 |
+
"transformer.h.7.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
557 |
+
"transformer.h.7.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
558 |
+
"transformer.h.7.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
559 |
+
"transformer.h.7.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
560 |
+
"transformer.h.8.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
561 |
+
"transformer.h.8.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
562 |
+
"transformer.h.8.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
563 |
+
"transformer.h.8.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
564 |
+
"transformer.h.8.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
565 |
+
"transformer.h.8.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
566 |
+
"transformer.h.8.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
567 |
+
"transformer.h.8.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
568 |
+
"transformer.h.8.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
569 |
+
"transformer.h.8.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
570 |
+
"transformer.h.8.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
571 |
+
"transformer.h.8.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
572 |
+
"transformer.h.9.attn.c_attn.bias": "pytorch_model-00001-of-00002.bin",
|
573 |
+
"transformer.h.9.attn.c_attn.weight": "pytorch_model-00001-of-00002.bin",
|
574 |
+
"transformer.h.9.attn.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
575 |
+
"transformer.h.9.attn.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
576 |
+
"transformer.h.9.ln_1.bias": "pytorch_model-00001-of-00002.bin",
|
577 |
+
"transformer.h.9.ln_1.weight": "pytorch_model-00001-of-00002.bin",
|
578 |
+
"transformer.h.9.ln_2.bias": "pytorch_model-00001-of-00002.bin",
|
579 |
+
"transformer.h.9.ln_2.weight": "pytorch_model-00001-of-00002.bin",
|
580 |
+
"transformer.h.9.mlp.c_fc.bias": "pytorch_model-00001-of-00002.bin",
|
581 |
+
"transformer.h.9.mlp.c_fc.weight": "pytorch_model-00001-of-00002.bin",
|
582 |
+
"transformer.h.9.mlp.c_proj.bias": "pytorch_model-00001-of-00002.bin",
|
583 |
+
"transformer.h.9.mlp.c_proj.weight": "pytorch_model-00001-of-00002.bin",
|
584 |
+
"transformer.ln_f.bias": "pytorch_model-00002-of-00002.bin",
|
585 |
+
"transformer.ln_f.weight": "pytorch_model-00002-of-00002.bin",
|
586 |
+
"transformer.wpe.weight": "pytorch_model-00001-of-00002.bin",
|
587 |
+
"transformer.wte.weight": "pytorch_model-00001-of-00002.bin"
|
588 |
+
}
|
589 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"mask_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "</s>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "<s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "<unk>",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": false,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<unk>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<s>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
}
|
27 |
+
},
|
28 |
+
"auto_map": {"AutoTokenizer":[null,"juman.JumanPreTrainedTokenizerFast"]},
|
29 |
+
"bos_token": "<s>",
|
30 |
+
"clean_up_tokenization_spaces": true,
|
31 |
+
"cls_token": "<s>",
|
32 |
+
"eos_token": "</s>",
|
33 |
+
"mask_token": "<unk>",
|
34 |
+
"model_max_length": 1024,
|
35 |
+
"pad_token": "</s>",
|
36 |
+
"padding_side": "right",
|
37 |
+
"sep_token": "<s>",
|
38 |
+
"tokenizer_class": "JumanPreTrainedTokenizerFast",
|
39 |
+
"truncation_side": "right",
|
40 |
+
"unk_token": "<unk>"
|
41 |
+
}
|
ud.py
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy
|
2 |
+
from transformers import TokenClassificationPipeline
|
3 |
+
|
4 |
+
class BellmanFordTokenClassificationPipeline(TokenClassificationPipeline):
|
5 |
+
def __init__(self,**kwargs):
|
6 |
+
super().__init__(**kwargs)
|
7 |
+
x=self.model.config.label2id
|
8 |
+
y=[k for k in x if k.startswith("B-") or not (k.startswith("I-") or k.endswith("|root") or k.find("|l-")>0 or k.find("|r-")>0)]
|
9 |
+
self.transition=numpy.full((len(x),len(x)),numpy.nan)
|
10 |
+
for k,v in x.items():
|
11 |
+
for j in ["I-"+k[2:]] if k.startswith("B-") else [k]+y if k.startswith("I-") else y:
|
12 |
+
self.transition[v,x[j]]=0
|
13 |
+
def check_model_type(self,supported_models):
|
14 |
+
pass
|
15 |
+
def postprocess(self,model_outputs,**kwargs):
|
16 |
+
if "logits" not in model_outputs:
|
17 |
+
return self.postprocess(model_outputs[0],**kwargs)
|
18 |
+
m=model_outputs["logits"][0].numpy()
|
19 |
+
e=numpy.exp(m-numpy.max(m,axis=-1,keepdims=True))
|
20 |
+
z=e/e.sum(axis=-1,keepdims=True)
|
21 |
+
for i in range(m.shape[0]-1,0,-1):
|
22 |
+
m[i-1]+=numpy.nanmax(m[i]+self.transition,axis=1)
|
23 |
+
k=[numpy.nanargmax(m[0]+self.transition[0])]
|
24 |
+
for i in range(1,m.shape[0]):
|
25 |
+
k.append(numpy.nanargmax(m[i]+self.transition[k[-1]]))
|
26 |
+
w=[{"entity":self.model.config.id2label[j],"start":s,"end":e,"score":z[i,j]} for i,((s,e),j) in enumerate(zip(model_outputs["offset_mapping"][0].tolist(),k)) if s<e]
|
27 |
+
if "aggregation_strategy" in kwargs and kwargs["aggregation_strategy"]!="none":
|
28 |
+
for i,t in reversed(list(enumerate(w))):
|
29 |
+
p=t.pop("entity")
|
30 |
+
if p.startswith("I-"):
|
31 |
+
w[i-1]["score"]=min(w[i-1]["score"],t["score"])
|
32 |
+
w[i-1]["end"]=w.pop(i)["end"]
|
33 |
+
elif p.startswith("B-"):
|
34 |
+
t["entity_group"]=p[2:]
|
35 |
+
else:
|
36 |
+
t["entity_group"]=p
|
37 |
+
for t in w:
|
38 |
+
t["text"]=model_outputs["sentence"][t["start"]:t["end"]]
|
39 |
+
return w
|
40 |
+
|
41 |
+
class UniversalDependenciesCausalPipeline(BellmanFordTokenClassificationPipeline):
|
42 |
+
def __init__(self,**kwargs):
|
43 |
+
kwargs["aggregation_strategy"]="simple"
|
44 |
+
super().__init__(**kwargs)
|
45 |
+
x=self.model.config.label2id
|
46 |
+
self.root=numpy.full((len(x)),numpy.nan)
|
47 |
+
self.left_arc=numpy.full((len(x)),numpy.nan)
|
48 |
+
self.right_arc=numpy.full((len(x)),numpy.nan)
|
49 |
+
for k,v in x.items():
|
50 |
+
if k.endswith("|root"):
|
51 |
+
self.root[v]=0
|
52 |
+
elif k.find("|l-")>0:
|
53 |
+
self.left_arc[v]=0
|
54 |
+
elif k.find("|r-")>0:
|
55 |
+
self.right_arc[v]=0
|
56 |
+
def postprocess(self,model_outputs,**kwargs):
|
57 |
+
import torch
|
58 |
+
if "logits" not in model_outputs:
|
59 |
+
return self.postprocess(model_outputs[0],**kwargs)
|
60 |
+
m=model_outputs["logits"][0].numpy()
|
61 |
+
for i in range(m.shape[0]-1,0,-1):
|
62 |
+
m[i-1]+=numpy.nanmax(m[i]+self.transition,axis=1)
|
63 |
+
k=[numpy.nanargmax(m[0]+self.transition[0])]
|
64 |
+
for i in range(1,m.shape[0]):
|
65 |
+
k.append(numpy.nanargmax(m[i]+self.transition[k[-1]]))
|
66 |
+
w=[{"entity":self.model.config.id2label[j],"start":s,"end":e} for i,((s,e),j) in enumerate(zip(model_outputs["offset_mapping"][0].tolist(),k)) if s<e]
|
67 |
+
for i,t in reversed(list(enumerate(w))):
|
68 |
+
p=t.pop("entity")
|
69 |
+
if p.startswith("I-"):
|
70 |
+
w[i-1]["end"]=max(w.pop(i)["end"],w[i-1]["end"])
|
71 |
+
elif i>0 and w[i-1]["end"]>w[i]["start"]:
|
72 |
+
w[i-1]["end"]=max(w.pop(i)["end"],w[i-1]["end"])
|
73 |
+
elif p.startswith("B-"):
|
74 |
+
t["entity_group"]=p[2:]
|
75 |
+
else:
|
76 |
+
t["entity_group"]=p
|
77 |
+
d=[model_outputs["sentence"][t["start"]:t["end"]] for t in w]
|
78 |
+
v=self.tokenizer(d,add_special_tokens=False)
|
79 |
+
e=self.model.get_input_embeddings().weight
|
80 |
+
m=[]
|
81 |
+
for x in v["input_ids"]:
|
82 |
+
if x==[]:
|
83 |
+
x=[self.tokenizer.unk_token_id]
|
84 |
+
m.append(e[x,:].sum(axis=0))
|
85 |
+
m.append(e[self.tokenizer.sep_token_id,:])
|
86 |
+
m.append(e[self.tokenizer.pad_token_id,:])
|
87 |
+
m=torch.stack(m).to(self.device)
|
88 |
+
k=list(range(len(d)+1))
|
89 |
+
e=[]
|
90 |
+
with torch.no_grad():
|
91 |
+
for i in range(len(d)):
|
92 |
+
e.append(self.model(inputs_embeds=torch.unsqueeze(m[k+list(range(i,len(d)))+[-1]*i,:],0)).logits[0,-len(d):,:])
|
93 |
+
e=torch.stack(e).cpu().numpy()
|
94 |
+
for i in range(len(d)):
|
95 |
+
for j in range(i):
|
96 |
+
e[-j-1,-i-1],e[-i-1,-j-1]=e[-i-1,i-j]+self.left_arc,e[-i-1,i-j]+self.right_arc
|
97 |
+
e[-i-1,-i-1]=e[-i-1,0]+self.root
|
98 |
+
m,p=numpy.nanmax(e,axis=2),numpy.nanargmax(e,axis=2)
|
99 |
+
h=self.chu_liu_edmonds(m)
|
100 |
+
z=[i for i,j in enumerate(h) if i==j]
|
101 |
+
if len(z)>1:
|
102 |
+
k,h=z[numpy.nanargmax(m[z,z])],numpy.nanmin(m)-numpy.nanmax(m)
|
103 |
+
m[:,z]+=[[0 if j in z and (i!=j or i==k) else h for i in z] for j in range(m.shape[0])]
|
104 |
+
h=self.chu_liu_edmonds(m)
|
105 |
+
q=[self.model.config.id2label[p[j,i]].split("|") for i,j in enumerate(h)]
|
106 |
+
t=model_outputs["sentence"].replace("\n"," ")
|
107 |
+
u="# text = "+t+"\n"
|
108 |
+
for i,j in enumerate(d):
|
109 |
+
u+="\t".join([str(i+1),j,"_",q[i][0],"_","_" if len(q[i])<3 else "|".join(q[i][1:-1]),str(0 if h[i]==i else h[i]+1),"root" if q[i][-1]=="root" else q[i][-1][2:],"_","_" if i+1<len(d) and w[i]["end"]<w[i+1]["start"] else "SpaceAfter=No"])+"\n"
|
110 |
+
return u+"\n"
|
111 |
+
def chu_liu_edmonds(self,matrix):
|
112 |
+
h=numpy.nanargmax(matrix,axis=0)
|
113 |
+
x=[-1 if i==j else j for i,j in enumerate(h)]
|
114 |
+
for b in [lambda x,i,j:-1 if i not in x else x[i],lambda x,i,j:-1 if j<0 else x[j]]:
|
115 |
+
y=[]
|
116 |
+
while x!=y:
|
117 |
+
y=list(x)
|
118 |
+
for i,j in enumerate(x):
|
119 |
+
x[i]=b(x,i,j)
|
120 |
+
if max(x)<0:
|
121 |
+
return h
|
122 |
+
y,x=[i for i,j in enumerate(x) if j==max(x)],[i for i,j in enumerate(x) if j<max(x)]
|
123 |
+
z=matrix-numpy.nanmax(matrix,axis=0)
|
124 |
+
m=numpy.block([[z[x,:][:,x],numpy.nanmax(z[x,:][:,y],axis=1).reshape(len(x),1)],[numpy.nanmax(z[y,:][:,x],axis=0),numpy.nanmax(z[y,y])]])
|
125 |
+
k=[j if i==len(x) else x[j] if j<len(x) else y[numpy.nanargmax(z[y,x[i]])] for i,j in enumerate(self.chu_liu_edmonds(m))]
|
126 |
+
h=[j if i in y else k[x.index(i)] for i,j in enumerate(h)]
|
127 |
+
i=y[numpy.nanargmax(z[x[k[-1]],y] if k[-1]<len(x) else z[y,y])]
|
128 |
+
h[i]=x[k[-1]] if k[-1]<len(x) else i
|
129 |
+
return h
|