inference code 수정
Browse files
README.md
CHANGED
|
@@ -29,6 +29,7 @@ question = "your question"
|
|
| 29 |
|
| 30 |
encodings = tokenizer(context, question, max_length=512, truncation=True,
|
| 31 |
padding="max_length", return_token_type_ids=False)
|
|
|
|
| 32 |
|
| 33 |
input_ids = encodings["input_ids"]
|
| 34 |
attention_mask = encodings["attention_mask"]
|
|
|
|
| 29 |
|
| 30 |
encodings = tokenizer(context, question, max_length=512, truncation=True,
|
| 31 |
padding="max_length", return_token_type_ids=False)
|
| 32 |
+
encodings = {key: torch.tensor([val]) for key, val in encodings.items()}
|
| 33 |
|
| 34 |
input_ids = encodings["input_ids"]
|
| 35 |
attention_mask = encodings["attention_mask"]
|