Prediction problem of glue task
I have trained the glue task for mrpc, and I want to load the pretrained model and predict for new sentence pairs.

```py
eval_dataset = load_dataset( "json", data_files={"test": "/home/aa/paraphrase/data/qqp/tt.json"})
eval_dataset = eval_dataset.map(preprocess_function, batched=False, load_from_cache_file=True)
print(eval_dataset['test']['idx'])

eval_dataset.remove_columns_("label")

trainer = Trainer(model=model, tokenizer=tokenizer)
predictions = trainer.predict(test_dataset=eval_dataset).predictions
print(predictions)
predictions = np.array([softmax(element) for element in predictions])[:, 1]
```

And I got this :

```
load model finish
Using custom data configuration default
Reusing dataset json (/home/aa/.cache/huggingface/datasets/json/default-8988cd19f10ded6e/0.0.0/70d89ed4db1394f028c651589fcab6d6b28dddcabbe39d3b21b4d41f9a708514)
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 1413.70ex/s]
[0, 1, 2, 3, 4, 5, 6, 7, 8]
Traceback (most recent call last):
  File "predict.py", line 89, in <module>
    predictions = trainer.predict(test_dataset=eval_dataset).predictions
  File "/home/aa/anaconda3/envs/transformer/lib/python3.7/site-packages/transformers/trainer.py", line 1381, in predict
    test_dataloader, description="Prediction", ignore_keys=ignore_keys, metric_key_prefix=metric_key_prefix
  File "/home/aa/anaconda3/envs/transformer/lib/python3.7/site-packages/transformers/trainer.py", line 1441, in prediction_loop
    for step, inputs in enumerate(dataloader):
  File "/home/aa/anaconda3/envs/transformer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
    data = self._next_data()
  File "/home/aa/anaconda3/envs/transformer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/home/aa/anaconda3/envs/transformer/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/aaanbo/anaconda3/envs/transformer/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
KeyError: 0
```

Why I got keyerror?
Anyone can help or show me how to use the pretrained models for sentence pair prediction?
<|||||>This issue has been automatically marked as stale and been closed because it has not had recent activity. Thank you for your contributions.

If you think this still needs to be addressed please comment on this thread.