Update README.md
Browse files
README.md
CHANGED
@@ -21,14 +21,6 @@ You can follow the prompts below to load our model parameters:
|
|
21 |
```python
|
22 |
from transformers import RobertaModel
|
23 |
model=RobertaModel.from_pretrained('ngwlh/KBioXLM')
|
24 |
-
checkpoint = torch.load('ngwlh/KBioXLM'+'/pytorch_model.bin', map_location='cpu')
|
25 |
-
new_state_dict=OrderedDict()
|
26 |
-
for k,v in checkpoint.items():
|
27 |
-
if k.startswith('model.roberta.'):
|
28 |
-
k=k.replace('model.roberta.','')
|
29 |
-
new_state_dict[k]=v
|
30 |
-
msg = model.load_state_dict(new_state_dict, strict=False)
|
31 |
-
logger.info(msg)
|
32 |
```
|
33 |
|
34 |
### BibTeX entry and citation info
|
|
|
21 |
```python
|
22 |
from transformers import RobertaModel
|
23 |
model=RobertaModel.from_pretrained('ngwlh/KBioXLM')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
```
|
25 |
|
26 |
### BibTeX entry and citation info
|