dainis-boumber
commited on
Commit
•
066c67b
1
Parent(s):
30fd217
Upload model
Browse files- README.md +43 -0
- adapter_config.json +74 -0
- head_config.json +20 -0
- pytorch_adapter.bin +3 -0
- pytorch_model_head.bin +3 -0
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- bert
|
4 |
+
- adapter-transformers
|
5 |
+
datasets:
|
6 |
+
- redasers/difraud
|
7 |
+
---
|
8 |
+
|
9 |
+
# Adapter `dainis-boumber/df-adapters-twitter-rumours` for bert-base-uncased
|
10 |
+
|
11 |
+
An [adapter](https://adapterhub.ml) for the `bert-base-uncased` model that was trained on the [redasers/difraud](https://huggingface.co/datasets/redasers/difraud/) dataset and includes a prediction head for classification.
|
12 |
+
|
13 |
+
This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
|
14 |
+
|
15 |
+
## Usage
|
16 |
+
|
17 |
+
First, install `adapter-transformers`:
|
18 |
+
|
19 |
+
```
|
20 |
+
pip install -U adapter-transformers
|
21 |
+
```
|
22 |
+
_Note: adapter-transformers is a fork of transformers that acts as a drop-in replacement with adapter support. [More](https://docs.adapterhub.ml/installation.html)_
|
23 |
+
|
24 |
+
Now, the adapter can be loaded and activated like this:
|
25 |
+
|
26 |
+
```python
|
27 |
+
from transformers import AutoAdapterModel
|
28 |
+
|
29 |
+
model = AutoAdapterModel.from_pretrained("bert-base-uncased")
|
30 |
+
adapter_name = model.load_adapter("dainis-boumber/df-adapters-twitter-rumours", source="hf", set_active=True)
|
31 |
+
```
|
32 |
+
|
33 |
+
## Architecture & Training
|
34 |
+
|
35 |
+
<!-- Add some description here -->
|
36 |
+
|
37 |
+
## Evaluation results
|
38 |
+
|
39 |
+
<!-- Add some description here -->
|
40 |
+
|
41 |
+
## Citation
|
42 |
+
|
43 |
+
<!-- Add some description here -->
|
adapter_config.json
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"architecture": "union",
|
4 |
+
"configs": [
|
5 |
+
{
|
6 |
+
"architecture": "prefix_tuning",
|
7 |
+
"bottleneck_size": 512,
|
8 |
+
"cross_prefix": true,
|
9 |
+
"dropout": 0.0,
|
10 |
+
"encoder_prefix": true,
|
11 |
+
"flat": false,
|
12 |
+
"leave_out": [],
|
13 |
+
"non_linearity": "tanh",
|
14 |
+
"prefix_length": 10,
|
15 |
+
"shared_gating": true,
|
16 |
+
"use_gating": true
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"adapter_residual_before_ln": false,
|
20 |
+
"cross_adapter": false,
|
21 |
+
"factorized_phm_W": true,
|
22 |
+
"factorized_phm_rule": false,
|
23 |
+
"hypercomplex_nonlinearity": "glorot-uniform",
|
24 |
+
"init_weights": "bert",
|
25 |
+
"inv_adapter": null,
|
26 |
+
"inv_adapter_reduction_factor": null,
|
27 |
+
"is_parallel": false,
|
28 |
+
"learn_phm": true,
|
29 |
+
"leave_out": [],
|
30 |
+
"ln_after": false,
|
31 |
+
"ln_before": false,
|
32 |
+
"mh_adapter": false,
|
33 |
+
"non_linearity": "relu",
|
34 |
+
"original_ln_after": true,
|
35 |
+
"original_ln_before": true,
|
36 |
+
"output_adapter": true,
|
37 |
+
"phm_bias": true,
|
38 |
+
"phm_c_init": "normal",
|
39 |
+
"phm_dim": 4,
|
40 |
+
"phm_init_range": 0.0001,
|
41 |
+
"phm_layer": false,
|
42 |
+
"phm_rank": 1,
|
43 |
+
"reduction_factor": 16,
|
44 |
+
"residual_before_ln": true,
|
45 |
+
"scaling": 1.0,
|
46 |
+
"shared_W_phm": false,
|
47 |
+
"shared_phm_rule": true,
|
48 |
+
"use_gating": true
|
49 |
+
},
|
50 |
+
{
|
51 |
+
"alpha": 8,
|
52 |
+
"architecture": "lora",
|
53 |
+
"attn_matrices": [
|
54 |
+
"q",
|
55 |
+
"v"
|
56 |
+
],
|
57 |
+
"composition_mode": "add",
|
58 |
+
"dropout": 0.0,
|
59 |
+
"init_weights": "lora",
|
60 |
+
"intermediate_lora": false,
|
61 |
+
"output_lora": false,
|
62 |
+
"r": 8,
|
63 |
+
"selfattn_lora": true,
|
64 |
+
"use_gating": true
|
65 |
+
}
|
66 |
+
]
|
67 |
+
},
|
68 |
+
"hidden_size": 768,
|
69 |
+
"model_class": "BertModelWithHeads",
|
70 |
+
"model_name": "bert-base-uncased",
|
71 |
+
"model_type": "bert",
|
72 |
+
"name": "difraud-twitter_rumours",
|
73 |
+
"version": "3.2.1"
|
74 |
+
}
|
head_config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"activation_function": "tanh",
|
4 |
+
"bias": true,
|
5 |
+
"head_type": "classification",
|
6 |
+
"label2id": {
|
7 |
+
"LABEL_0": 0,
|
8 |
+
"LABEL_1": 1
|
9 |
+
},
|
10 |
+
"layers": 2,
|
11 |
+
"num_labels": 2,
|
12 |
+
"use_pooler": false
|
13 |
+
},
|
14 |
+
"hidden_size": 768,
|
15 |
+
"model_class": "BertModelWithHeads",
|
16 |
+
"model_name": "bert-base-uncased",
|
17 |
+
"model_type": "bert",
|
18 |
+
"name": "difraud-twitter_rumours",
|
19 |
+
"version": "3.2.1"
|
20 |
+
}
|
pytorch_adapter.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9b8dd0aded280e6c9e61c9f0e81f652abbfe02733b52693929c8c96011ad5a0
|
3 |
+
size 44420463
|
pytorch_model_head.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:97cd6de8c6777d56f1d15047fc7155430fbde96f61d972d416d6a85ff0052506
|
3 |
+
size 2370273
|