deepset-ai / FARM

:house_with_garden: Fast & easy transfer learning for NLP. Harvesting language models for the industry. Focus on Question Answering.
https://farm.deepset.ai
Apache License 2.0
1.73k stars 247 forks source link

Use correct class when transforming DPR models #833

Closed bogdankostic closed 3 years ago

bogdankostic commented 3 years ago

When trying to convert a DPR model to transformers, DPRQuestionEncoder is used for the context encoder model. This is due to the fact that transformer's AutoModel always creates a DPRQuestionEncoder when it is passed a DPRConfig. This PR ensures that we use DPRContextEncoder for the context encoder model.

Timoeller commented 3 years ago

Nice catch. What would be the consequence of using a DPRQuestionEncoder for the context?