<h2 dir="auto">Environment info</h2>

<ul dir="auto">
<li><code class="notranslate">transformers</code> version:3.4.0</li>
<li>Platform:linux</li>
<li>Python version:3.6</li>
<li>PyTorch version (GPU?):1.6 cuda10</li>
<li>Tensorflow version (GPU?):</li>
<li>Using GPU in script?:</li>
<li>Using distributed or parallel set-up in script?:</li>
</ul>
<p dir="auto">When I try to train roberta-wwm from scratch for my dataset , I get this error when I follow transformers' run_mlm_wwm.py code</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="!python run_mlm_wwm.py --model_name_or_path hfl/chinese-roberta-wwm-ext --train_file ../../../../pretrain_data/pretrain_train.txt --validation_file ../../../../pretrain_data/pretrain_val.txt --train_ref_file ../../../../pretrain_data/ref_train.txt --validation_ref_file ../../../../pretrain_data/ref_val.txt --do_train --do_eval --output_dir ./output"><pre class="notranslate"><code class="notranslate">!python run_mlm_wwm.py --model_name_or_path hfl/chinese-roberta-wwm-ext --train_file ../../../../pretrain_data/pretrain_train.txt --validation_file ../../../../pretrain_data/pretrain_val.txt --train_ref_file ../../../../pretrain_data/ref_train.txt --validation_ref_file ../../../../pretrain_data/ref_val.txt --do_train --do_eval --output_dir ./output
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="All the weights of BertForMaskedLM were initialized from the model checkpoint at hfl/chinese-roberta-wwm-ext.
If your task is similar to the task the model of the checkpoint was trained on, you can already use BertForMaskedLM for predictions without further training.
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.
Traceback (most recent call last):
  File &quot;run_mlm_wwm.py&quot;, line 333, in &lt;module&gt;
    main()
  File &quot;run_mlm_wwm.py&quot;, line 274, in main
    load_from_cache_file=not data_args.overwrite_cache,
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/dataset_dict.py&quot;, line 300, in map
    for k, dataset in self.items()
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/dataset_dict.py&quot;, line 300, in &lt;dictcomp&gt;
    for k, dataset in self.items()
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py&quot;, line 1256, in map
    update_data=update_data,
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py&quot;, line 156, in wrapper
    out: Union[&quot;Dataset&quot;, &quot;DatasetDict&quot;] = func(self, *args, **kwargs)
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py&quot;, line 158, in wrapper
    self._fingerprint, transform, kwargs_for_fingerprint
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py&quot;, line 105, in update_fingerprint
    hasher.update(transform_args[key])
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py&quot;, line 57, in update
    self.m.update(self.hash(value).encode(&quot;utf-8&quot;))
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py&quot;, line 53, in hash
    return cls.hash_default(value)
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py&quot;, line 46, in hash_default
    return cls.hash_bytes(dumps(value))
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py&quot;, line 367, in dumps
    dump(obj, file)
  File &quot;/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py&quot;, line 339, in dump
    Pickler(file, recurse=True).dump(obj)
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 454, in dump
    StockPickler.dump(self, obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 409, in dump
    self.save(obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 1447, in save_function
    obj.__dict__, fkwdefaults), obj=obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 751, in save_tuple
    save(element)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 736, in save_tuple
    save(element)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 1178, in save_cell
    pickler.save_reduce(_create_cell, (f,), obj=obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 736, in save_tuple
    save(element)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 521, in save
    self.save_reduce(obj=obj, *rv)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 605, in save_reduce
    save(cls)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 1374, in save_type
    obj.__bases__, _dict), obj=obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 751, in save_tuple
    save(element)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 821, in save_dict
    self._batch_setitems(obj.items())
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 847, in _batch_setitems
    save(v)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/usr/local/lib/python3.6/dist-packages/dill/_dill.py&quot;, line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 821, in save_dict
    self._batch_setitems(obj.items())
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 847, in _batch_setitems
    save(v)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 507, in save
    self.save_global(obj, rv)
  File &quot;/usr/lib/python3.6/pickle.py&quot;, line 927, in save_global
    (obj, module_name, name))
**_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union**"><pre class="notranslate"><code class="notranslate">All the weights of BertForMaskedLM were initialized from the model checkpoint at hfl/chinese-roberta-wwm-ext.
If your task is similar to the task the model of the checkpoint was trained on, you can already use BertForMaskedLM for predictions without further training.
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.
Traceback (most recent call last):
  File "run_mlm_wwm.py", line 333, in &lt;module&gt;
    main()
  File "run_mlm_wwm.py", line 274, in main
    load_from_cache_file=not data_args.overwrite_cache,
  File "/usr/local/lib/python3.6/dist-packages/datasets/dataset_dict.py", line 300, in map
    for k, dataset in self.items()
  File "/usr/local/lib/python3.6/dist-packages/datasets/dataset_dict.py", line 300, in &lt;dictcomp&gt;
    for k, dataset in self.items()
  File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py", line 1256, in map
    update_data=update_data,
  File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py", line 156, in wrapper
    out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py", line 158, in wrapper
    self._fingerprint, transform, kwargs_for_fingerprint
  File "/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py", line 105, in update_fingerprint
    hasher.update(transform_args[key])
  File "/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py", line 57, in update
    self.m.update(self.hash(value).encode("utf-8"))
  File "/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py", line 53, in hash
    return cls.hash_default(value)
  File "/usr/local/lib/python3.6/dist-packages/datasets/fingerprint.py", line 46, in hash_default
    return cls.hash_bytes(dumps(value))
  File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 367, in dumps
    dump(obj, file)
  File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 339, in dump
    Pickler(file, recurse=True).dump(obj)
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 454, in dump
    StockPickler.dump(self, obj)
  File "/usr/lib/python3.6/pickle.py", line 409, in dump
    self.save(obj)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 1447, in save_function
    obj.__dict__, fkwdefaults), obj=obj)
  File "/usr/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python3.6/pickle.py", line 751, in save_tuple
    save(element)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python3.6/pickle.py", line 736, in save_tuple
    save(element)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 1178, in save_cell
    pickler.save_reduce(_create_cell, (f,), obj=obj)
  File "/usr/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python3.6/pickle.py", line 736, in save_tuple
    save(element)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 605, in save_reduce
    save(cls)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 1374, in save_type
    obj.__bases__, _dict), obj=obj)
  File "/usr/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python3.6/pickle.py", line 751, in save_tuple
    save(element)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 507, in save
    self.save_global(obj, rv)
  File "/usr/lib/python3.6/pickle.py", line 927, in save_global
    (obj, module_name, name))
**_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union**
</code></pre></div>
<p dir="auto">please help me.</p>
<p dir="auto">While fine-tuning BERT with the new <a href="https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm.py">script</a> I am facing the issue as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;run_mlm.py&quot;, line 310, in &lt;module&gt;
    main()
  File &quot;run_mlm.py&quot;, line 259, in main
    load_from_cache_file=not data_args.overwrite_cache,
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/dataset_dict.py&quot;, line 300, in map
    for k, dataset in self.items()
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/dataset_dict.py&quot;, line 300, in &lt;dictcomp&gt;
    for k, dataset in self.items()
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/arrow_dataset.py&quot;, line 1256, in map
    update_data=update_data,
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/arrow_dataset.py&quot;, line 156, in wrapper
    out: Union[&quot;Dataset&quot;, &quot;DatasetDict&quot;] = func(self, *args, **kwargs)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py&quot;, line 158, in wrapper
    self._fingerprint, transform, kwargs_for_fingerprint
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py&quot;, line 105, in update_fingerprint
    hasher.update(transform_args[key])
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py&quot;, line 57, in update
    self.m.update(self.hash(value).encode(&quot;utf-8&quot;))
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py&quot;, line 53, in hash
    return cls.hash_default(value)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py&quot;, line 46, in hash_default
    return cls.hash_bytes(dumps(value))
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/utils/py_utils.py&quot;, line 367, in dumps
    dump(obj, file)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/utils/py_utils.py&quot;, line 339, in dump
    Pickler(file, recurse=True).dump(obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 446, in dump
    StockPickler.dump(self, obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 409, in dump
    self.save(obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 1438, in save_function
    obj.__dict__, fkwdefaults), obj=obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 751, in save_tuple
    save(element)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 736, in save_tuple
    save(element)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 1170, in save_cell
    pickler.save_reduce(_create_cell, (f,), obj=obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 736, in save_tuple
    save(element)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 521, in save
    self.save_reduce(obj=obj, *rv)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 605, in save_reduce
    save(cls)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 1365, in save_type
    obj.__bases__, _dict), obj=obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 610, in save_reduce
    save(args)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 751, in save_tuple
    save(element)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 933, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 821, in save_dict
    self._batch_setitems(obj.items())
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 847, in _batch_setitems
    save(v)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py&quot;, line 933, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 821, in save_dict
    self._batch_setitems(obj.items())
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 847, in _batch_setitems
    save(v)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 507, in save
    self.save_global(obj, rv)
  File &quot;/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py&quot;, line 927, in save_global
    (obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union

"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "run_mlm.py", line 310, in &lt;module&gt;
    main()
  File "run_mlm.py", line 259, in main
    load_from_cache_file=not data_args.overwrite_cache,
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in map
    for k, dataset in self.items()
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in &lt;dictcomp&gt;
    for k, dataset in self.items()
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1256, in map
    update_data=update_data,
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 156, in wrapper
    out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py", line 158, in wrapper
    self._fingerprint, transform, kwargs_for_fingerprint
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py", line 105, in update_fingerprint
    hasher.update(transform_args[key])
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py", line 57, in update
    self.m.update(self.hash(value).encode("utf-8"))
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py", line 53, in hash
    return cls.hash_default(value)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/fingerprint.py", line 46, in hash_default
    return cls.hash_bytes(dumps(value))
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 367, in dumps
    dump(obj, file)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 339, in dump
    Pickler(file, recurse=True).dump(obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
    StockPickler.dump(self, obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 409, in dump
    self.save(obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
    obj.__dict__, fkwdefaults), obj=obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 751, in save_tuple
    save(element)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 736, in save_tuple
    save(element)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
    pickler.save_reduce(_create_cell, (f,), obj=obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 736, in save_tuple
    save(element)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 605, in save_reduce
    save(cls)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
    obj.__bases__, _dict), obj=obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 610, in save_reduce
    save(args)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 751, in save_tuple
    save(element)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 507, in save
    self.save_global(obj, rv)
  File "/home/ai-students/anaconda3/envs/env_nesara/lib/python3.6/pickle.py", line 927, in save_global
    (obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union


</code></pre></div>
<p dir="auto">I am trying to run the same script with the already mentioned wikitext dataset. However, I am not able to run it successfully due to the above mentioned error.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sgugger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sgugger">@sgugger</a> Could you please help me resolve this error?</p>