nicoladecao
commited on
Commit
•
2250d38
1
Parent(s):
24bee6f
Update README.md
Browse files
README.md
CHANGED
@@ -46,7 +46,7 @@ Here is an example of generation for Wikipedia page retrieval for open-domain fa
|
|
46 |
|
47 |
```python
|
48 |
import pickle
|
49 |
-
from transformers import
|
50 |
|
51 |
# OPTIONAL: load the prefix tree (trie), you need to additionally download
|
52 |
# https://huggingface.co/facebook/genre-kilt/blob/main/trie.py and
|
@@ -55,8 +55,8 @@ from transformers import BartTokenizer, BartForConditionalGeneration
|
|
55 |
# with open("kilt_titles_trie_dict.pkl", "rb") as f:
|
56 |
# trie = Trie.load_from_dict(pickle.load(f))
|
57 |
|
58 |
-
tokenizer =
|
59 |
-
model =
|
60 |
|
61 |
sentences = ["Einstein was a German physicist."]
|
62 |
|
|
|
46 |
|
47 |
```python
|
48 |
import pickle
|
49 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
50 |
|
51 |
# OPTIONAL: load the prefix tree (trie), you need to additionally download
|
52 |
# https://huggingface.co/facebook/genre-kilt/blob/main/trie.py and
|
|
|
55 |
# with open("kilt_titles_trie_dict.pkl", "rb") as f:
|
56 |
# trie = Trie.load_from_dict(pickle.load(f))
|
57 |
|
58 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/genre-kilt")
|
59 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/genre-kilt").eval()
|
60 |
|
61 |
sentences = ["Einstein was a German physicist."]
|
62 |
|