Cannot unpickle saved .pt dataset with torch.save()/load()
{'login': 'vegarab', 'id': 24683907, 'node_id': 'MDQ6VXNlcjI0NjgzOTA3', 'avatar_url': 'https://avatars.githubusercontent.com/u/24683907?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/vegarab', 'html_url': 'https://github.com/vegarab', 'followers_url': 'https://api.github.com/users/vegarab/followers', 'following_url': 'https://api.github.com/users/vegarab/following{/other_user}', 'gists_url': 'https://api.github.com/users/vegarab/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/vegarab/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/vegarab/subscriptions', 'organizations_url': 'https://api.github.com/users/vegarab/orgs', 'repos_url': 'https://api.github.com/users/vegarab/repos', 'events_url': 'https://api.github.com/users/vegarab/events{/privacy}', 'received_events_url': 'https://api.github.com/users/vegarab/received_events', 'type': 'User', 'site_admin': False}
[]
[]
This seems to be fixed in a non-released version. 

Installing nlp from source
```
git clone https://github.com/huggingface/nlp
cd nlp
pip install .
```
solves the issue. 
Saving a formatted torch dataset to file using `torch.save()`. Loading the same file fails during unpickling:

```python
>>> import torch
>>> import nlp

>>> squad = nlp.load_dataset("squad.py", split="train")
>>> squad
Dataset(features: {'source_text': Value(dtype='string', id=None), 'target_text': Value(dtype='string', id=None)}, num_rows: 87599)
>>> squad = squad.map(create_features, batched=True)
>>> squad.set_format(type="torch", columns=["source_ids", "target_ids", "attention_mask"])
>>> torch.save(squad, "squad.pt")

>>> squad_pt = torch.load("squad.pt")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 593, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 773, in _legacy_load
    result = unpickler.load()
  File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/splits.py", line 493, in __setitem__
    raise ValueError("Cannot add elem. Use .add() instead.")
ValueError: Cannot add elem. Use .add() instead.
```
where `create_features` is a function that tokenizes the data using `batch_encode_plus` and returns a Dict with `input_ids`, `target_ids` and `attention_mask`. 
```python
def create_features(batch):
    source_text_encoding = tokenizer.batch_encode_plus(
        batch["source_text"],
        max_length=max_source_length,
        pad_to_max_length=True,
        truncation=True)

    target_text_encoding = tokenizer.batch_encode_plus(
        batch["target_text"],
        max_length=max_target_length,
        pad_to_max_length=True,
        truncation=True)

    features = {
        "source_ids": source_text_encoding["input_ids"],
        "target_ids": target_text_encoding["input_ids"],
        "attention_mask": source_text_encoding["attention_mask"]
    }

    return features
```

I found a similar issue in [issue 5267 in the huggingface/transformers repo](https://github.com/huggingface/transformers/issues/5267) which was solved by downgrading to `nlp==0.2.0`. That did not solve this problem, however. 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/443/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}