Commit
•
1fba766
1
Parent(s):
eb4a89c
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
This model is a non-finetuned RAG-Token model and was created as follows:
|
2 |
+
```python
|
3 |
+
from transformers import RagTokenizer, RagSequenceForGeneration, AutoTokenizer
|
4 |
+
|
5 |
+
model = RagSequenceForGeneration.from_pretrained_question_encoder_generator(
|
6 |
+
"facebook/dpr-question_encoder-single-nq-base",
|
7 |
+
"facebook/bart-base"
|
8 |
+
)
|
9 |
+
|
10 |
+
question_encoder_tokenizer = AutoTokenizer.from_pretrained("facebook/dpr-question_encoder-single-nq-base")
|
11 |
+
generator_tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
|
12 |
+
|
13 |
+
tokenizer = RagTokenizer(question_encoder_tokenizer, generator_tokenizer)
|
14 |
+
model.config.use_dummy_dataset = True
|
15 |
+
model.config.index_name = "exact"
|
16 |
+
|
17 |
+
model.save_pretrained("./")
|
18 |
+
tokenizer.save_pretrained("./")
|
19 |
+
```
|