laituan245's picture
Create README.md
1fba766
|
raw
history blame
714 Bytes

This model is a non-finetuned RAG-Token model and was created as follows:

from transformers import RagTokenizer, RagSequenceForGeneration, AutoTokenizer

model = RagSequenceForGeneration.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("./")