Update README.md
Browse files
README.md
CHANGED
@@ -10,6 +10,9 @@ language:
|
|
10 |
|
11 |
# SPECTER2 Base
|
12 |
|
|
|
|
|
|
|
13 |
|
14 |
**Aug 2023 Update:**
|
15 |
1. **The SPECTER2 Base and proximity adapter models have been renamed in Hugging Face based upon usage patterns as follows:**
|
@@ -25,7 +28,7 @@ language:
|
|
25 |
|
26 |
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.
|
27 |
|
28 |
-
This adapter was created for usage with the **[
|
29 |
|
30 |
## SPECTER2
|
31 |
|
@@ -87,13 +90,14 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
|
|
87 |
*Proximity model should suffice for downstream task types not mentioned above
|
88 |
|
89 |
```python
|
90 |
-
from transformers import AutoTokenizer
|
|
|
91 |
|
92 |
# load model and tokenizer
|
93 |
tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_base')
|
94 |
|
95 |
#load base model
|
96 |
-
model =
|
97 |
|
98 |
#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
|
99 |
model.load_adapter("allenai/specter2", source="hf", load_as="proximity", set_active=True)
|
|
|
10 |
|
11 |
# SPECTER2 Base
|
12 |
|
13 |
+
**Dec 2023 Update:**
|
14 |
+
|
15 |
+
Model usage updated to be compatible with latest versions of transformers and adapters (newly released update to adapter-transformers) libraries.
|
16 |
|
17 |
**Aug 2023 Update:**
|
18 |
1. **The SPECTER2 Base and proximity adapter models have been renamed in Hugging Face based upon usage patterns as follows:**
|
|
|
28 |
|
29 |
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.
|
30 |
|
31 |
+
This adapter was created for usage with the **[adapters](https://github.com/adapter-hub/adapters)** library.
|
32 |
|
33 |
## SPECTER2
|
34 |
|
|
|
90 |
*Proximity model should suffice for downstream task types not mentioned above
|
91 |
|
92 |
```python
|
93 |
+
from transformers import AutoTokenizer
|
94 |
+
from adapters import AutoAdapterModel
|
95 |
|
96 |
# load model and tokenizer
|
97 |
tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_base')
|
98 |
|
99 |
#load base model
|
100 |
+
model = AutoAdapterModel.from_pretrained('allenai/specter2_base')
|
101 |
|
102 |
#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
|
103 |
model.load_adapter("allenai/specter2", source="hf", load_as="proximity", set_active=True)
|