Spaces:
Sleeping
Sleeping
namanviber
commited on
Commit
•
3dd595e
1
Parent(s):
dd3a1e8
Upload 16 files
Browse files- Legal-LED_IN_ABS/README.md +202 -0
- Legal-LED_IN_ABS/adapter_config.json +81 -0
- Legal-LED_IN_ABS/adapter_model.safetensors +3 -0
- Legal-LED_IN_ABS/merges.txt +0 -0
- Legal-LED_IN_ABS/optimizer.pt +3 -0
- Legal-LED_IN_ABS/rng_state.pth +3 -0
- Legal-LED_IN_ABS/scheduler.pt +3 -0
- Legal-LED_IN_ABS/special_tokens_map.json +51 -0
- Legal-LED_IN_ABS/tokenizer.json +0 -0
- Legal-LED_IN_ABS/tokenizer_config.json +57 -0
- Legal-LED_IN_ABS/trainer_state.json +279 -0
- Legal-LED_IN_ABS/training_args.bin +3 -0
- Legal-LED_IN_ABS/vocab.json +0 -0
- app.py +51 -0
- img.png +0 -0
- requirements.txt +4 -0
Legal-LED_IN_ABS/README.md
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: peft
|
3 |
+
base_model: nsi319/legal-led-base-16384
|
4 |
+
---
|
5 |
+
|
6 |
+
# Model Card for Model ID
|
7 |
+
|
8 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
## Model Details
|
13 |
+
|
14 |
+
### Model Description
|
15 |
+
|
16 |
+
<!-- Provide a longer summary of what this model is. -->
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
- **Developed by:** [More Information Needed]
|
21 |
+
- **Funded by [optional]:** [More Information Needed]
|
22 |
+
- **Shared by [optional]:** [More Information Needed]
|
23 |
+
- **Model type:** [More Information Needed]
|
24 |
+
- **Language(s) (NLP):** [More Information Needed]
|
25 |
+
- **License:** [More Information Needed]
|
26 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
+
|
28 |
+
### Model Sources [optional]
|
29 |
+
|
30 |
+
<!-- Provide the basic links for the model. -->
|
31 |
+
|
32 |
+
- **Repository:** [More Information Needed]
|
33 |
+
- **Paper [optional]:** [More Information Needed]
|
34 |
+
- **Demo [optional]:** [More Information Needed]
|
35 |
+
|
36 |
+
## Uses
|
37 |
+
|
38 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
+
|
40 |
+
### Direct Use
|
41 |
+
|
42 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
+
|
44 |
+
[More Information Needed]
|
45 |
+
|
46 |
+
### Downstream Use [optional]
|
47 |
+
|
48 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
+
|
50 |
+
[More Information Needed]
|
51 |
+
|
52 |
+
### Out-of-Scope Use
|
53 |
+
|
54 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
+
|
56 |
+
[More Information Needed]
|
57 |
+
|
58 |
+
## Bias, Risks, and Limitations
|
59 |
+
|
60 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Recommendations
|
65 |
+
|
66 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
+
|
68 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
+
|
70 |
+
## How to Get Started with the Model
|
71 |
+
|
72 |
+
Use the code below to get started with the model.
|
73 |
+
|
74 |
+
[More Information Needed]
|
75 |
+
|
76 |
+
## Training Details
|
77 |
+
|
78 |
+
### Training Data
|
79 |
+
|
80 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
+
|
82 |
+
[More Information Needed]
|
83 |
+
|
84 |
+
### Training Procedure
|
85 |
+
|
86 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
+
|
88 |
+
#### Preprocessing [optional]
|
89 |
+
|
90 |
+
[More Information Needed]
|
91 |
+
|
92 |
+
|
93 |
+
#### Training Hyperparameters
|
94 |
+
|
95 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
+
|
97 |
+
#### Speeds, Sizes, Times [optional]
|
98 |
+
|
99 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
+
|
101 |
+
[More Information Needed]
|
102 |
+
|
103 |
+
## Evaluation
|
104 |
+
|
105 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
+
|
107 |
+
### Testing Data, Factors & Metrics
|
108 |
+
|
109 |
+
#### Testing Data
|
110 |
+
|
111 |
+
<!-- This should link to a Dataset Card if possible. -->
|
112 |
+
|
113 |
+
[More Information Needed]
|
114 |
+
|
115 |
+
#### Factors
|
116 |
+
|
117 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
#### Metrics
|
122 |
+
|
123 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Results
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
#### Summary
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
## Model Examination [optional]
|
136 |
+
|
137 |
+
<!-- Relevant interpretability work for the model goes here -->
|
138 |
+
|
139 |
+
[More Information Needed]
|
140 |
+
|
141 |
+
## Environmental Impact
|
142 |
+
|
143 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
+
|
145 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
+
|
147 |
+
- **Hardware Type:** [More Information Needed]
|
148 |
+
- **Hours used:** [More Information Needed]
|
149 |
+
- **Cloud Provider:** [More Information Needed]
|
150 |
+
- **Compute Region:** [More Information Needed]
|
151 |
+
- **Carbon Emitted:** [More Information Needed]
|
152 |
+
|
153 |
+
## Technical Specifications [optional]
|
154 |
+
|
155 |
+
### Model Architecture and Objective
|
156 |
+
|
157 |
+
[More Information Needed]
|
158 |
+
|
159 |
+
### Compute Infrastructure
|
160 |
+
|
161 |
+
[More Information Needed]
|
162 |
+
|
163 |
+
#### Hardware
|
164 |
+
|
165 |
+
[More Information Needed]
|
166 |
+
|
167 |
+
#### Software
|
168 |
+
|
169 |
+
[More Information Needed]
|
170 |
+
|
171 |
+
## Citation [optional]
|
172 |
+
|
173 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
+
|
175 |
+
**BibTeX:**
|
176 |
+
|
177 |
+
[More Information Needed]
|
178 |
+
|
179 |
+
**APA:**
|
180 |
+
|
181 |
+
[More Information Needed]
|
182 |
+
|
183 |
+
## Glossary [optional]
|
184 |
+
|
185 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
+
|
187 |
+
[More Information Needed]
|
188 |
+
|
189 |
+
## More Information [optional]
|
190 |
+
|
191 |
+
[More Information Needed]
|
192 |
+
|
193 |
+
## Model Card Authors [optional]
|
194 |
+
|
195 |
+
[More Information Needed]
|
196 |
+
|
197 |
+
## Model Card Contact
|
198 |
+
|
199 |
+
[More Information Needed]
|
200 |
+
### Framework versions
|
201 |
+
|
202 |
+
- PEFT 0.10.0
|
Legal-LED_IN_ABS/adapter_config.json
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "nsi319/legal-led-base-16384",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": false,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layer_replication": null,
|
10 |
+
"layers_pattern": null,
|
11 |
+
"layers_to_transform": null,
|
12 |
+
"loftq_config": {},
|
13 |
+
"lora_alpha": 32,
|
14 |
+
"lora_dropout": 0.1,
|
15 |
+
"megatron_config": null,
|
16 |
+
"megatron_core": "megatron.core",
|
17 |
+
"modules_to_save": null,
|
18 |
+
"peft_type": "LORA",
|
19 |
+
"r": 4,
|
20 |
+
"rank_pattern": {},
|
21 |
+
"revision": null,
|
22 |
+
"target_modules": [
|
23 |
+
"led.encoder.layers.4.self_attn.longformer_self_attn.key",
|
24 |
+
"led.decoder.layers.1.encoder_attn.k_proj",
|
25 |
+
"led.decoder.layers.1.self_attn.v_proj",
|
26 |
+
"led.decoder.layers.2.self_attn.k_proj",
|
27 |
+
"led.encoder.layers.1.self_attn.longformer_self_attn.key",
|
28 |
+
"led.encoder.layers.2.self_attn.longformer_self_attn.value",
|
29 |
+
"led.encoder.layers.0.self_attn.longformer_self_attn.query",
|
30 |
+
"led.decoder.layers.5.encoder_attn.k_proj",
|
31 |
+
"led.encoder.layers.5.self_attn.longformer_self_attn.query",
|
32 |
+
"led.decoder.layers.5.self_attn.v_proj",
|
33 |
+
"led.encoder.layers.3.self_attn.longformer_self_attn.key",
|
34 |
+
"led.decoder.layers.3.encoder_attn.q_proj",
|
35 |
+
"led.decoder.layers.2.encoder_attn.v_proj",
|
36 |
+
"led.encoder.layers.0.self_attn.longformer_self_attn.value",
|
37 |
+
"led.decoder.layers.2.self_attn.q_proj",
|
38 |
+
"led.encoder.layers.1.self_attn.longformer_self_attn.query",
|
39 |
+
"led.decoder.layers.3.self_attn.q_proj",
|
40 |
+
"led.decoder.layers.5.encoder_attn.v_proj",
|
41 |
+
"led.decoder.layers.4.self_attn.k_proj",
|
42 |
+
"led.decoder.layers.1.self_attn.q_proj",
|
43 |
+
"led.encoder.layers.1.self_attn.longformer_self_attn.value",
|
44 |
+
"led.encoder.layers.3.self_attn.longformer_self_attn.query",
|
45 |
+
"led.encoder.layers.0.self_attn.longformer_self_attn.key",
|
46 |
+
"led.encoder.layers.4.self_attn.longformer_self_attn.query",
|
47 |
+
"led.decoder.layers.0.self_attn.k_proj",
|
48 |
+
"led.decoder.layers.2.self_attn.v_proj",
|
49 |
+
"led.decoder.layers.0.self_attn.v_proj",
|
50 |
+
"led.encoder.layers.3.self_attn.longformer_self_attn.value",
|
51 |
+
"led.encoder.layers.5.self_attn.longformer_self_attn.value",
|
52 |
+
"led.decoder.layers.4.encoder_attn.k_proj",
|
53 |
+
"led.decoder.layers.5.encoder_attn.q_proj",
|
54 |
+
"led.decoder.layers.0.encoder_attn.v_proj",
|
55 |
+
"led.encoder.layers.2.self_attn.longformer_self_attn.query",
|
56 |
+
"led.decoder.layers.0.self_attn.q_proj",
|
57 |
+
"led.decoder.layers.3.self_attn.k_proj",
|
58 |
+
"led.decoder.layers.0.encoder_attn.q_proj",
|
59 |
+
"led.decoder.layers.3.self_attn.v_proj",
|
60 |
+
"led.decoder.layers.4.encoder_attn.q_proj",
|
61 |
+
"led.decoder.layers.2.encoder_attn.k_proj",
|
62 |
+
"led.encoder.layers.4.self_attn.longformer_self_attn.value",
|
63 |
+
"led.decoder.layers.1.self_attn.k_proj",
|
64 |
+
"led.decoder.layers.1.encoder_attn.q_proj",
|
65 |
+
"led.decoder.layers.4.self_attn.q_proj",
|
66 |
+
"led.decoder.layers.4.encoder_attn.v_proj",
|
67 |
+
"led.decoder.layers.1.encoder_attn.v_proj",
|
68 |
+
"led.decoder.layers.4.self_attn.v_proj",
|
69 |
+
"led.decoder.layers.5.self_attn.q_proj",
|
70 |
+
"led.encoder.layers.2.self_attn.longformer_self_attn.key",
|
71 |
+
"led.decoder.layers.2.encoder_attn.q_proj",
|
72 |
+
"led.decoder.layers.5.self_attn.k_proj",
|
73 |
+
"led.decoder.layers.3.encoder_attn.v_proj",
|
74 |
+
"led.encoder.layers.5.self_attn.longformer_self_attn.key",
|
75 |
+
"led.decoder.layers.3.encoder_attn.k_proj",
|
76 |
+
"led.decoder.layers.0.encoder_attn.k_proj"
|
77 |
+
],
|
78 |
+
"task_type": "SUMMARIZATION",
|
79 |
+
"use_dora": false,
|
80 |
+
"use_rslora": false
|
81 |
+
}
|
Legal-LED_IN_ABS/adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:768d20dd4b448772f8c62f5cfc1c20494d506678aa1d68f94746956aec85fe5b
|
3 |
+
size 1342456
|
Legal-LED_IN_ABS/merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Legal-LED_IN_ABS/optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d341317be5693df2dd1d9636341166d40c8af8467051bd34cdc7d0fda452ee0
|
3 |
+
size 2745082
|
Legal-LED_IN_ABS/rng_state.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2bee791231a99ff85057b54f035f640c56d457ea6ced79092eee7bd4510f79ba
|
3 |
+
size 14244
|
Legal-LED_IN_ABS/scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d20436381cde63e4ef4154c4facf935d7fceed96cba77d169e67689352a860ba
|
3 |
+
size 1064
|
Legal-LED_IN_ABS/special_tokens_map.json
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": true,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"mask_token": {
|
24 |
+
"content": "<mask>",
|
25 |
+
"lstrip": true,
|
26 |
+
"normalized": true,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": true,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "</s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": true,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "<unk>",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": true,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
+
}
|
Legal-LED_IN_ABS/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Legal-LED_IN_ABS/tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"0": {
|
5 |
+
"content": "<s>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"1": {
|
13 |
+
"content": "<pad>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": true,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"2": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": true,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
},
|
28 |
+
"3": {
|
29 |
+
"content": "<unk>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": true,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false,
|
34 |
+
"special": true
|
35 |
+
},
|
36 |
+
"50264": {
|
37 |
+
"content": "<mask>",
|
38 |
+
"lstrip": true,
|
39 |
+
"normalized": true,
|
40 |
+
"rstrip": false,
|
41 |
+
"single_word": false,
|
42 |
+
"special": true
|
43 |
+
}
|
44 |
+
},
|
45 |
+
"bos_token": "<s>",
|
46 |
+
"clean_up_tokenization_spaces": true,
|
47 |
+
"cls_token": "<s>",
|
48 |
+
"eos_token": "</s>",
|
49 |
+
"errors": "replace",
|
50 |
+
"mask_token": "<mask>",
|
51 |
+
"model_max_length": 16384,
|
52 |
+
"pad_token": "<pad>",
|
53 |
+
"sep_token": "</s>",
|
54 |
+
"tokenizer_class": "LEDTokenizer",
|
55 |
+
"trim_offsets": true,
|
56 |
+
"unk_token": "<unk>"
|
57 |
+
}
|
Legal-LED_IN_ABS/trainer_state.json
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": 28.664,
|
3 |
+
"best_model_checkpoint": "results/Legal-LED/IndiaABS/exp1\\checkpoint-1757",
|
4 |
+
"epoch": 0.9997155049786629,
|
5 |
+
"eval_steps": 500,
|
6 |
+
"global_step": 1757,
|
7 |
+
"is_hyper_param_search": false,
|
8 |
+
"is_local_process_zero": true,
|
9 |
+
"is_world_process_zero": true,
|
10 |
+
"log_history": [
|
11 |
+
{
|
12 |
+
"epoch": 0.03,
|
13 |
+
"grad_norm": 5.772658348083496,
|
14 |
+
"learning_rate": 1.225e-05,
|
15 |
+
"loss": 4.2551,
|
16 |
+
"step": 50
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"epoch": 0.06,
|
20 |
+
"grad_norm": 2.3984649181365967,
|
21 |
+
"learning_rate": 2.4750000000000002e-05,
|
22 |
+
"loss": 3.4607,
|
23 |
+
"step": 100
|
24 |
+
},
|
25 |
+
{
|
26 |
+
"epoch": 0.09,
|
27 |
+
"grad_norm": 1.634371042251587,
|
28 |
+
"learning_rate": 3.7250000000000004e-05,
|
29 |
+
"loss": 2.7537,
|
30 |
+
"step": 150
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"epoch": 0.11,
|
34 |
+
"grad_norm": 1.7180700302124023,
|
35 |
+
"learning_rate": 4.975e-05,
|
36 |
+
"loss": 2.5124,
|
37 |
+
"step": 200
|
38 |
+
},
|
39 |
+
{
|
40 |
+
"epoch": 0.14,
|
41 |
+
"grad_norm": 1.7759343385696411,
|
42 |
+
"learning_rate": 4.842646114322415e-05,
|
43 |
+
"loss": 2.3961,
|
44 |
+
"step": 250
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"epoch": 0.17,
|
48 |
+
"grad_norm": 1.5487947463989258,
|
49 |
+
"learning_rate": 4.6820809248554915e-05,
|
50 |
+
"loss": 2.373,
|
51 |
+
"step": 300
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"epoch": 0.2,
|
55 |
+
"grad_norm": 1.6271101236343384,
|
56 |
+
"learning_rate": 4.521515735388568e-05,
|
57 |
+
"loss": 2.3289,
|
58 |
+
"step": 350
|
59 |
+
},
|
60 |
+
{
|
61 |
+
"epoch": 0.23,
|
62 |
+
"grad_norm": 1.7767431735992432,
|
63 |
+
"learning_rate": 4.360950545921644e-05,
|
64 |
+
"loss": 2.3136,
|
65 |
+
"step": 400
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"epoch": 0.26,
|
69 |
+
"grad_norm": 1.5476394891738892,
|
70 |
+
"learning_rate": 4.2003853564547206e-05,
|
71 |
+
"loss": 2.228,
|
72 |
+
"step": 450
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"epoch": 0.28,
|
76 |
+
"grad_norm": 2.2447686195373535,
|
77 |
+
"learning_rate": 4.039820166987797e-05,
|
78 |
+
"loss": 2.2193,
|
79 |
+
"step": 500
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"epoch": 0.31,
|
83 |
+
"grad_norm": 2.0830910205841064,
|
84 |
+
"learning_rate": 3.879254977520873e-05,
|
85 |
+
"loss": 2.244,
|
86 |
+
"step": 550
|
87 |
+
},
|
88 |
+
{
|
89 |
+
"epoch": 0.34,
|
90 |
+
"grad_norm": 1.8925021886825562,
|
91 |
+
"learning_rate": 3.7186897880539504e-05,
|
92 |
+
"loss": 2.2185,
|
93 |
+
"step": 600
|
94 |
+
},
|
95 |
+
{
|
96 |
+
"epoch": 0.37,
|
97 |
+
"grad_norm": 1.9989118576049805,
|
98 |
+
"learning_rate": 3.558124598587027e-05,
|
99 |
+
"loss": 2.2333,
|
100 |
+
"step": 650
|
101 |
+
},
|
102 |
+
{
|
103 |
+
"epoch": 0.4,
|
104 |
+
"grad_norm": 2.6363413333892822,
|
105 |
+
"learning_rate": 3.397559409120103e-05,
|
106 |
+
"loss": 2.1538,
|
107 |
+
"step": 700
|
108 |
+
},
|
109 |
+
{
|
110 |
+
"epoch": 0.43,
|
111 |
+
"grad_norm": 2.3027186393737793,
|
112 |
+
"learning_rate": 3.2369942196531794e-05,
|
113 |
+
"loss": 2.2577,
|
114 |
+
"step": 750
|
115 |
+
},
|
116 |
+
{
|
117 |
+
"epoch": 0.46,
|
118 |
+
"grad_norm": 1.6798630952835083,
|
119 |
+
"learning_rate": 3.076429030186256e-05,
|
120 |
+
"loss": 2.203,
|
121 |
+
"step": 800
|
122 |
+
},
|
123 |
+
{
|
124 |
+
"epoch": 0.48,
|
125 |
+
"grad_norm": 2.2237415313720703,
|
126 |
+
"learning_rate": 2.915863840719332e-05,
|
127 |
+
"loss": 2.1747,
|
128 |
+
"step": 850
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"epoch": 0.51,
|
132 |
+
"grad_norm": 2.019179105758667,
|
133 |
+
"learning_rate": 2.755298651252409e-05,
|
134 |
+
"loss": 2.1642,
|
135 |
+
"step": 900
|
136 |
+
},
|
137 |
+
{
|
138 |
+
"epoch": 0.54,
|
139 |
+
"grad_norm": 1.8116823434829712,
|
140 |
+
"learning_rate": 2.5947334617854852e-05,
|
141 |
+
"loss": 2.0992,
|
142 |
+
"step": 950
|
143 |
+
},
|
144 |
+
{
|
145 |
+
"epoch": 0.57,
|
146 |
+
"grad_norm": 2.7756757736206055,
|
147 |
+
"learning_rate": 2.4341682723185612e-05,
|
148 |
+
"loss": 2.073,
|
149 |
+
"step": 1000
|
150 |
+
},
|
151 |
+
{
|
152 |
+
"epoch": 0.6,
|
153 |
+
"grad_norm": 2.4382846355438232,
|
154 |
+
"learning_rate": 2.2736030828516376e-05,
|
155 |
+
"loss": 2.1295,
|
156 |
+
"step": 1050
|
157 |
+
},
|
158 |
+
{
|
159 |
+
"epoch": 0.63,
|
160 |
+
"grad_norm": 1.680977702140808,
|
161 |
+
"learning_rate": 2.1130378933847143e-05,
|
162 |
+
"loss": 2.1131,
|
163 |
+
"step": 1100
|
164 |
+
},
|
165 |
+
{
|
166 |
+
"epoch": 0.65,
|
167 |
+
"grad_norm": 2.0901172161102295,
|
168 |
+
"learning_rate": 1.9524727039177907e-05,
|
169 |
+
"loss": 2.145,
|
170 |
+
"step": 1150
|
171 |
+
},
|
172 |
+
{
|
173 |
+
"epoch": 0.68,
|
174 |
+
"grad_norm": 1.953476071357727,
|
175 |
+
"learning_rate": 1.791907514450867e-05,
|
176 |
+
"loss": 2.1414,
|
177 |
+
"step": 1200
|
178 |
+
},
|
179 |
+
{
|
180 |
+
"epoch": 0.71,
|
181 |
+
"grad_norm": 2.1726927757263184,
|
182 |
+
"learning_rate": 1.6313423249839434e-05,
|
183 |
+
"loss": 2.1293,
|
184 |
+
"step": 1250
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"epoch": 0.74,
|
188 |
+
"grad_norm": 1.8229079246520996,
|
189 |
+
"learning_rate": 1.4707771355170199e-05,
|
190 |
+
"loss": 2.1369,
|
191 |
+
"step": 1300
|
192 |
+
},
|
193 |
+
{
|
194 |
+
"epoch": 0.77,
|
195 |
+
"grad_norm": 2.71445631980896,
|
196 |
+
"learning_rate": 1.3102119460500964e-05,
|
197 |
+
"loss": 2.0934,
|
198 |
+
"step": 1350
|
199 |
+
},
|
200 |
+
{
|
201 |
+
"epoch": 0.8,
|
202 |
+
"grad_norm": 2.6795523166656494,
|
203 |
+
"learning_rate": 1.1496467565831728e-05,
|
204 |
+
"loss": 2.0734,
|
205 |
+
"step": 1400
|
206 |
+
},
|
207 |
+
{
|
208 |
+
"epoch": 0.83,
|
209 |
+
"grad_norm": 2.1377625465393066,
|
210 |
+
"learning_rate": 9.890815671162493e-06,
|
211 |
+
"loss": 2.1422,
|
212 |
+
"step": 1450
|
213 |
+
},
|
214 |
+
{
|
215 |
+
"epoch": 0.85,
|
216 |
+
"grad_norm": 1.7045388221740723,
|
217 |
+
"learning_rate": 8.285163776493257e-06,
|
218 |
+
"loss": 2.0615,
|
219 |
+
"step": 1500
|
220 |
+
},
|
221 |
+
{
|
222 |
+
"epoch": 0.88,
|
223 |
+
"grad_norm": 2.001119375228882,
|
224 |
+
"learning_rate": 6.679511881824021e-06,
|
225 |
+
"loss": 2.0652,
|
226 |
+
"step": 1550
|
227 |
+
},
|
228 |
+
{
|
229 |
+
"epoch": 0.91,
|
230 |
+
"grad_norm": 2.5513315200805664,
|
231 |
+
"learning_rate": 5.0738599871547856e-06,
|
232 |
+
"loss": 2.1465,
|
233 |
+
"step": 1600
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"epoch": 0.94,
|
237 |
+
"grad_norm": 1.8909486532211304,
|
238 |
+
"learning_rate": 3.468208092485549e-06,
|
239 |
+
"loss": 2.0798,
|
240 |
+
"step": 1650
|
241 |
+
},
|
242 |
+
{
|
243 |
+
"epoch": 0.97,
|
244 |
+
"grad_norm": 1.9534186124801636,
|
245 |
+
"learning_rate": 1.8625561978163134e-06,
|
246 |
+
"loss": 2.0924,
|
247 |
+
"step": 1700
|
248 |
+
},
|
249 |
+
{
|
250 |
+
"epoch": 1.0,
|
251 |
+
"grad_norm": 2.080364465713501,
|
252 |
+
"learning_rate": 2.569043031470777e-07,
|
253 |
+
"loss": 2.0598,
|
254 |
+
"step": 1750
|
255 |
+
},
|
256 |
+
{
|
257 |
+
"epoch": 1.0,
|
258 |
+
"eval_gen_len": 815.03,
|
259 |
+
"eval_loss": 2.0449941158294678,
|
260 |
+
"eval_rouge1": 55.6012,
|
261 |
+
"eval_rouge2": 28.664,
|
262 |
+
"eval_rougeL": 26.4007,
|
263 |
+
"eval_rougeLsum": 53.0454,
|
264 |
+
"eval_runtime": 14551.3385,
|
265 |
+
"eval_samples_per_second": 0.007,
|
266 |
+
"eval_steps_per_second": 0.007,
|
267 |
+
"step": 1757
|
268 |
+
}
|
269 |
+
],
|
270 |
+
"logging_steps": 50,
|
271 |
+
"max_steps": 1757,
|
272 |
+
"num_input_tokens_seen": 0,
|
273 |
+
"num_train_epochs": 1,
|
274 |
+
"save_steps": 500,
|
275 |
+
"total_flos": 3.806868794454835e+16,
|
276 |
+
"train_batch_size": 1,
|
277 |
+
"trial_name": null,
|
278 |
+
"trial_params": null
|
279 |
+
}
|
Legal-LED_IN_ABS/training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b887e532dd0881e53b48f5222fe9c8cb2db6be354c3d43fca9c4d476016987c1
|
3 |
+
size 5048
|
Legal-LED_IN_ABS/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
+
from peft import PeftModel
|
4 |
+
|
5 |
+
# Loading LED IN Model
|
6 |
+
base_model = "nsi319/legal-led-base-16384"
|
7 |
+
led = AutoModelForSeq2SeqLM.from_pretrained(base_model)
|
8 |
+
adapter_model_in = f"Legal-LED_IN_ABS"
|
9 |
+
led_in = PeftModel.from_pretrained(led, adapter_model_in)
|
10 |
+
led_in_tokenizer = AutoTokenizer.from_pretrained(base_model)
|
11 |
+
|
12 |
+
# Generating Summary
|
13 |
+
def summarize(model, tokenizer, text):
|
14 |
+
input_tokenized = tokenizer.encode(text, return_tensors='pt', max_length=8192, truncation=True)
|
15 |
+
summary_ids = model.generate(input_tokenized, num_beams=4, length_penalty=0.1, min_length=32, max_length=512)
|
16 |
+
summary = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids][0]
|
17 |
+
return summary
|
18 |
+
|
19 |
+
# Reading Txt File
|
20 |
+
def read_txt_file(file):
|
21 |
+
text = file.read().decode('utf-8')
|
22 |
+
return text
|
23 |
+
|
24 |
+
st.set_page_config(page_title="Legal AI Summarizer", page_icon="img.png")
|
25 |
+
title = "Legal AI Summarizer"
|
26 |
+
col1, col2 = st.columns([1,7])
|
27 |
+
with col1:
|
28 |
+
st.image("img.png")
|
29 |
+
with col2: st.title(title)
|
30 |
+
st.write("Stuck with long legal documents? Our AI summarizer can help! Just copy-paste the text or upload a .txt file, and it will give you a quick and easy summary in plain English, so you can understand the key points without all the legalese.")
|
31 |
+
|
32 |
+
if "user_text" not in st.session_state:
|
33 |
+
st.session_state.user_text = ""
|
34 |
+
|
35 |
+
upload_file = st.file_uploader("Upload a .txt file", type="txt")
|
36 |
+
|
37 |
+
if upload_file is not None:
|
38 |
+
user_text = read_txt_file(upload_file)
|
39 |
+
else:
|
40 |
+
user_text = st.text_area("Paste your legal document here:", value=st.session_state.user_text, height=300)
|
41 |
+
|
42 |
+
if st.button("Generate Summary"):
|
43 |
+
with st.spinner("Generating summary..."):
|
44 |
+
try:
|
45 |
+
summary_text = summarize(led_in, led_in_tokenizer, user_text)
|
46 |
+
st.session_state.user_text = user_text
|
47 |
+
st.write("")
|
48 |
+
st.success(summary_text)
|
49 |
+
print(summary_text)
|
50 |
+
except Exception as e:
|
51 |
+
st.error(f"An error occurred: {e}")
|
img.png
ADDED
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
transformers
|
3 |
+
peft
|
4 |
+
torch
|