aps6992 commited on
Commit
2c7a46c
1 Parent(s): 8bfb730

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -7
README.md CHANGED
@@ -10,7 +10,11 @@ datasets:
10
 
11
  An [adapter](https://adapterhub.ml) for the [allenai/specter2_base](https://huggingface.co/allenai/specter2_base) 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
  **Aug 2023 Update:**
16
  1. **The SPECTER2 Base and proximity adapter models have been renamed in Hugging Face based upon usage patterns as follows:**
@@ -38,17 +42,17 @@ Given the combination of title and abstract of a scientific paper or a short tex
38
 
39
  ## Usage
40
 
41
- First, install `adapter-transformers`:
42
 
43
  ```
44
- pip install -U adapter-transformers
45
  ```
46
- _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)_
47
 
48
  Now, the adapter can be loaded and activated like this:
49
 
50
  ```python
51
- from transformers import AutoAdapterModel
52
 
53
  model = AutoAdapterModel.from_pretrained("allenai/specter2_base")
54
  adapter_name = model.load_adapter("allenai/specter2", source="hf", set_active=True)
@@ -106,13 +110,14 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
106
 
107
 
108
  ```python
109
- from transformers import AutoTokenizer, AutoModel
 
110
 
111
  # load model and tokenizer
112
  tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_base')
113
 
114
  #load base model
115
- model = AutoModel.from_pretrained('allenai/specter2_base')
116
 
117
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
118
  model.load_adapter("allenai/specter2", source="hf", load_as="specter2", set_active=True)
 
10
 
11
  An [adapter](https://adapterhub.ml) for the [allenai/specter2_base](https://huggingface.co/allenai/specter2_base) 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
  **Aug 2023 Update:**
20
  1. **The SPECTER2 Base and proximity adapter models have been renamed in Hugging Face based upon usage patterns as follows:**
 
42
 
43
  ## Usage
44
 
45
+ First, install `adapters`:
46
 
47
  ```
48
+ pip install -U adapters
49
  ```
50
+ _Note: adapters is an add on to transformers and acts as a drop-in replacement with adapter support. [More](https://docs.adapterhub.ml/installation.html)_
51
 
52
  Now, the adapter can be loaded and activated like this:
53
 
54
  ```python
55
+ from adapters import AutoAdapterModel
56
 
57
  model = AutoAdapterModel.from_pretrained("allenai/specter2_base")
58
  adapter_name = model.load_adapter("allenai/specter2", source="hf", set_active=True)
 
110
 
111
 
112
  ```python
113
+ from transformers import AutoTokenizer
114
+ from adapters import AutoAdapterModel
115
 
116
  # load model and tokenizer
117
  tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_base')
118
 
119
  #load base model
120
+ model = AutoAdapterModel.from_pretrained('allenai/specter2_base')
121
 
122
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
123
  model.load_adapter("allenai/specter2", source="hf", load_as="specter2", set_active=True)