|
This model is a non-finetuned RAG-Token model and was created as follows: |
|
```python |
|
from transformers import RagTokenizer, RagTokenForGeneration, AutoTokenizer |
|
|
|
model = RagTokenForGeneration.from_pretrained_question_encoder_generator( |
|
"facebook/dpr-question_encoder-single-nq-base", |
|
"facebook/bart-base" |
|
) |
|
|
|
question_encoder_tokenizer = AutoTokenizer.from_pretrained("facebook/dpr-question_encoder-single-nq-base") |
|
generator_tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base") |
|
|
|
tokenizer = RagTokenizer(question_encoder_tokenizer, generator_tokenizer) |
|
model.config.use_dummy_dataset = True |
|
model.config.index_name = "exact" |
|
|
|
model.save_pretrained("./") |
|
tokenizer.save_pretrained("./") |
|
``` |
|
|