lenglaender commited on
Commit
6800751
·
verified ·
1 Parent(s): 880ad03

Upload model

Browse files
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - t5
4
+ - adapter-transformers
5
+ datasets:
6
+ - yelp_polarity
7
+ ---
8
+
9
+ # Adapter `lenglaender/xlm-roberta-base-lora-cls-yelp-polarity` for google-t5/t5-base
10
+
11
+ An [adapter](https://adapterhub.ml) for the `google-t5/t5-base` model that was trained on the [yelp_polarity](https://huggingface.co/datasets/yelp_polarity/) dataset and includes a prediction head for classification.
12
+
13
+ This adapter was created for usage with the **[Adapters](https://github.com/Adapter-Hub/adapters)** library.
14
+
15
+ ## Usage
16
+
17
+ First, install `adapters`:
18
+
19
+ ```
20
+ pip install -U adapters
21
+ ```
22
+
23
+ Now, the adapter can be loaded and activated like this:
24
+
25
+ ```python
26
+ from adapters import AutoAdapterModel
27
+
28
+ model = AutoAdapterModel.from_pretrained("google-t5/t5-base")
29
+ adapter_name = model.load_adapter("lenglaender/xlm-roberta-base-lora-cls-yelp-polarity", source="hf", set_active=True)
30
+ ```
31
+
32
+ ## Architecture & Training
33
+
34
+ LoRA has r=8 and alpha=8 and was trained with dropout=0.1
35
+
36
+ ## Evaluation results
37
+
38
+ Accuracy on Amazon polarity dataset: 98.15%
39
+
40
+ ## Citation
adapter_config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "alpha": 8,
4
+ "architecture": "lora",
5
+ "attn_matrices": [
6
+ "q",
7
+ "v"
8
+ ],
9
+ "composition_mode": "add",
10
+ "dropout": 0.1,
11
+ "init_weights": "lora",
12
+ "intermediate_lora": false,
13
+ "leave_out": [],
14
+ "output_lora": false,
15
+ "r": 8,
16
+ "selfattn_lora": true,
17
+ "use_gating": false
18
+ },
19
+ "hidden_size": 768,
20
+ "model_class": "T5AdapterModel",
21
+ "model_name": "google-t5/t5-base",
22
+ "model_type": "t5",
23
+ "name": "yelp_cls",
24
+ "version": "0.2.0"
25
+ }
head_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "activation_function": "tanh",
4
+ "bias": true,
5
+ "dropout_prob": null,
6
+ "head_type": "classification",
7
+ "label2id": {
8
+ "0": 0,
9
+ "1": 1
10
+ },
11
+ "layers": 2,
12
+ "num_labels": 2,
13
+ "use_pooler": false
14
+ },
15
+ "hidden_size": 768,
16
+ "model_class": "T5AdapterModel",
17
+ "model_name": "google-t5/t5-base",
18
+ "model_type": "t5",
19
+ "name": "yelp_cls",
20
+ "version": "0.2.0"
21
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a4378b448742a245d3b95235c925f0ba04d27e409421c20835a6bad4aecd977
3
+ size 3590834
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50ae06653d7d7ef6b8737822f72dd359c874e0e80d377a37656c5ba3a89475fb
3
+ size 2370664