calpt commited on
Commit
f42ca86
1 Parent(s): c6b8843

Initial version.

Browse files
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - roberta
4
+ - adapterhub:qa/cq
5
+ - adapter-transformers
6
+ language:
7
+ - en
8
+ ---
9
+
10
+ # Adapter `AdapterHub/roberta-base-pf-cq` for roberta-base
11
+
12
+ An [adapter](https://adapterhub.ml) for the `roberta-base` model that was trained on the [qa/cq](https://adapterhub.ml/explore/qa/cq/) dataset and includes a prediction head for question answering.
13
+
14
+ This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
15
+
16
+ ## Usage
17
+
18
+ First, install `adapter-transformers`:
19
+
20
+ ```
21
+ pip install -U adapter-transformers
22
+ ```
23
+ _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)_
24
+
25
+ Now, the adapter can be loaded and activated like this:
26
+
27
+ ```python
28
+ from transformers import AutoModelWithHeads
29
+
30
+ model = AutoModelWithHeads.from_pretrained("roberta-base")
31
+ adapter_name = model.load_adapter("AdapterHub/roberta-base-pf-cq", source="hf")
32
+ model.active_adapters = adapter_name
33
+ ```
34
+
35
+ ## Architecture & Training
36
+
37
+ The training code for this adapter is available at https://github.com/adapter-hub/efficient-task-transfer.
38
+ In particular, training configurations for all tasks can be found [here](https://github.com/adapter-hub/efficient-task-transfer/tree/master/run_configs).
39
+
40
+
41
+ ## Evaluation results
42
+
43
+ Refer to [the paper](https://arxiv.org/pdf/2104.08247) for more information on results.
44
+
45
+ ## Citation
46
+
47
+ If you use this adapter, please cite our paper ["What to Pre-Train on? Efficient Intermediate Task Selection"](https://arxiv.org/pdf/2104.08247):
48
+
49
+ ```bibtex
50
+ @inproceedings{poth-etal-2021-what-to-pre-train-on,
51
+ title={What to Pre-Train on? Efficient Intermediate Task Selection},
52
+ author={Clifton Poth and Jonas Pfeiffer and Andreas Rücklé and Iryna Gurevych},
53
+ booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
54
+ month = nov,
55
+ year = "2021",
56
+ address = "Online",
57
+ publisher = "Association for Computational Linguistics",
58
+ url = "https://arxiv.org/abs/2104.08247",
59
+ pages = "to appear",
60
+ }
61
+ ```
adapter_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "adapter_residual_before_ln": false,
4
+ "cross_adapter": false,
5
+ "inv_adapter": null,
6
+ "inv_adapter_reduction_factor": null,
7
+ "leave_out": [],
8
+ "ln_after": false,
9
+ "ln_before": false,
10
+ "mh_adapter": false,
11
+ "non_linearity": "relu",
12
+ "original_ln_after": true,
13
+ "original_ln_before": true,
14
+ "output_adapter": true,
15
+ "reduction_factor": 16,
16
+ "residual_before_ln": true
17
+ },
18
+ "hidden_size": 768,
19
+ "model_class": "RobertaModelWithHeads",
20
+ "model_name": "roberta-base",
21
+ "model_type": "roberta",
22
+ "name": "cq"
23
+ }
head_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "activation_function": "tanh",
4
+ "head_type": "question_answering",
5
+ "label2id": {
6
+ "LABEL_0": 0,
7
+ "LABEL_1": 1
8
+ },
9
+ "layers": 1,
10
+ "num_labels": 2
11
+ },
12
+ "hidden_size": 768,
13
+ "model_class": "RobertaModelWithHeads",
14
+ "model_name": "roberta-base",
15
+ "model_type": "roberta",
16
+ "name": "cq"
17
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e41689f794a0a21056d08b4ffb9a350ecbe6cdcae98a0064a18bd25232721e80
3
+ size 3594607
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:100fab112e3734822ea044c77ef208afe564bcf0dc988a7d389a0c9c8a51baa4
3
+ size 7223