Update README.md
Browse files
README.md
CHANGED
@@ -18,10 +18,10 @@ LFQA DPR-based retriever (vblagoje/dpr-question_encoder-single-lfqa-wiki and vbl
|
|
18 |
|
19 |
|
20 |
```python
|
21 |
-
|
|
|
22 |
model = DPRQuestionEncoder.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-wiki").to(device)
|
23 |
tokenizer = AutoTokenizer.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-wiki")
|
24 |
-
_ = model.eval()
|
25 |
|
26 |
input_ids = tokenizer("Why do airplanes leave contrails in the sky?", return_tensors="pt")["input_ids"]
|
27 |
embeddings = model(input_ids).pooler_output
|
|
|
18 |
|
19 |
|
20 |
```python
|
21 |
+
from transformers import DPRContextEncoder, DPRContextEncoderTokenizer
|
22 |
+
|
23 |
model = DPRQuestionEncoder.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-wiki").to(device)
|
24 |
tokenizer = AutoTokenizer.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-wiki")
|
|
|
25 |
|
26 |
input_ids = tokenizer("Why do airplanes leave contrails in the sky?", return_tensors="pt")["input_ids"]
|
27 |
embeddings = model(input_ids).pooler_output
|