Update README.md
Browse files
README.md
CHANGED
|
@@ -30,11 +30,11 @@ documents = [
|
|
| 30 |
docs = "<p> " + " <p> ".join([d for d in documents])
|
| 31 |
q = "Q: {}\n\nC: {}".format(query, docs)
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
generated_answers_encoded = model.generate(
|
| 36 |
-
input_ids=
|
| 37 |
-
attention_mask=
|
| 38 |
min_length=64,
|
| 39 |
max_length=256,
|
| 40 |
do_sample=False,
|
|
|
|
| 30 |
docs = "<p> " + " <p> ".join([d for d in documents])
|
| 31 |
q = "Q: {}\n\nC: {}".format(query, docs)
|
| 32 |
|
| 33 |
+
input_qc = tokenizer(query_and_docs, truncation=True, padding=True, return_tensors="pt")
|
| 34 |
|
| 35 |
generated_answers_encoded = model.generate(
|
| 36 |
+
input_ids=input_qc["input_ids"].to(device),
|
| 37 |
+
attention_mask=input_qc["attention_mask"].to(device),
|
| 38 |
min_length=64,
|
| 39 |
max_length=256,
|
| 40 |
do_sample=False,
|