aps6992 commited on
Commit
b255d24
·
1 Parent(s): bdf1c2d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -7
README.md CHANGED
@@ -10,21 +10,26 @@ datasets:
10
 
11
  An [adapter](https://adapterhub.ml) for the `None` model that was trained on the [allenai/scirepeval](https://huggingface.co/datasets/allenai/scirepeval/) dataset.
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("allenai/specter2_aug2023refresh_base")
30
  adapter_name = model.load_adapter("allenai/specter2_aug2023refresh_adhoc_query", source="hf", set_active=True)
@@ -93,13 +98,14 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
93
  *Retrieval model should suffice for downstream task types not mentioned above
94
 
95
  ```python
96
- from transformers import AutoTokenizer, AutoModel
 
97
 
98
  # load model and tokenizer
99
  tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_aug2023refresh_base')
100
 
101
  #load base model
102
- model = AutoModel.from_pretrained('allenai/specter2_aug2023refresh_base')
103
 
104
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
105
  model.load_adapter("allenai/specter2_aug2023refresh_adhoc_query", source="hf", load_as="specter2_adhoc_query", set_active=True)
 
10
 
11
  An [adapter](https://adapterhub.ml) for the `None` model that was trained on the [allenai/scirepeval](https://huggingface.co/datasets/allenai/scirepeval/) dataset.
12
 
13
+ This adapter was created for usage with the **[adapters](https://github.com/adapter-hub/adapters)** library.
14
+
15
+ **Dec 2023 Update:**
16
+
17
+ Model usage updated to be compatible with latest versions of transformers and adapters (newly released update to adapter-transformers) libraries.
18
+
19
 
20
  ## Usage
21
 
22
+ First, install `adapters`:
23
 
24
  ```
25
+ pip install -U adapters
26
  ```
27
+ _Note: adapters is built as an add-on to transformers that acts as a drop-in replacement with adapter support. [More](https://docs.adapterhub.ml)_
28
 
29
  Now, the adapter can be loaded and activated like this:
30
 
31
  ```python
32
+ from adapters import AutoAdapterModel
33
 
34
  model = AutoAdapterModel.from_pretrained("allenai/specter2_aug2023refresh_base")
35
  adapter_name = model.load_adapter("allenai/specter2_aug2023refresh_adhoc_query", source="hf", set_active=True)
 
98
  *Retrieval model should suffice for downstream task types not mentioned above
99
 
100
  ```python
101
+ from transformers import AutoTokenizer
102
+ from adapters import AutoAdapterModel
103
 
104
  # load model and tokenizer
105
  tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_aug2023refresh_base')
106
 
107
  #load base model
108
+ model = AutoAdapterModel.from_pretrained('allenai/specter2_aug2023refresh_base')
109
 
110
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
111
  model.load_adapter("allenai/specter2_aug2023refresh_adhoc_query", source="hf", load_as="specter2_adhoc_query", set_active=True)