Update README.md
Browse files
README.md
CHANGED
@@ -5,12 +5,13 @@ license: apache-2.0
|
|
5 |
|
6 |
tags:
|
7 |
- bart
|
|
|
8 |
- biomedical
|
9 |
|
10 |
inference: true
|
11 |
|
12 |
widget:
|
13 |
-
- text: ""
|
14 |
|
15 |
---
|
16 |
# Yuyuan-Bart-139M, one model of [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM).
|
@@ -32,13 +33,11 @@ from transformers import BartForConditionalGeneration, BartTokenizer
|
|
32 |
tokenizer = BartTokenizer.from_pretrained('IDEA-CCNL/Yuyuan-Bart-139M')
|
33 |
model = BartForConditionalGeneration.from_pretrained('IDEA-CCNL/Yuyuan-Bart-139M')
|
34 |
|
35 |
-
|
36 |
-
text = 'Results are presented of measuring fibrinogen fluorescence parameters in <mask> range of 20-80 degrees C at different pH of the <mask>.'
|
37 |
input_ids = tokenizer([text], return_tensors="pt")['input_ids']
|
38 |
model.eval()
|
39 |
generated_ids = model.generate(
|
40 |
input_ids=input_ids,
|
41 |
-
max_length=64,
|
42 |
)
|
43 |
preds = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True) for g in generated_ids]
|
44 |
print(preds)
|
|
|
5 |
|
6 |
tags:
|
7 |
- bart
|
8 |
+
- biobart
|
9 |
- biomedical
|
10 |
|
11 |
inference: true
|
12 |
|
13 |
widget:
|
14 |
+
- text: "Influenza is a <mask> disease."
|
15 |
|
16 |
---
|
17 |
# Yuyuan-Bart-139M, one model of [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM).
|
|
|
33 |
tokenizer = BartTokenizer.from_pretrained('IDEA-CCNL/Yuyuan-Bart-139M')
|
34 |
model = BartForConditionalGeneration.from_pretrained('IDEA-CCNL/Yuyuan-Bart-139M')
|
35 |
|
36 |
+
text = 'Influenza is a <mask> disease.'
|
|
|
37 |
input_ids = tokenizer([text], return_tensors="pt")['input_ids']
|
38 |
model.eval()
|
39 |
generated_ids = model.generate(
|
40 |
input_ids=input_ids,
|
|
|
41 |
)
|
42 |
preds = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True) for g in generated_ids]
|
43 |
print(preds)
|