# Cannot import Data Collator For PLM

**URL:** <https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395>\
**Category:** 🤗Transformers\
**Created:** [July 20, 2020, 11:05am UTC](https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395 "2020-07-20T11:05:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![krannnN](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@krannnN](https://discuss.huggingface.co/u/krannnN)\
**Post date:** [July 20, 2020, 11:05am UTC](https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395/1 "2020-07-20T11:05:32Z")

</div>

Hello, I was testing the new added feature to transofrmers in 3.0 which is the ability to continue training trasnformers models ( XLNet in my case) but I’m getting this error:

```
2020-07-20 10:47:29.463663: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):
  File "run_language_modeling.py", line 29, in <module>
    from transformers import (
ImportError: cannot import name 'DataCollatorForPermutationLanguageModeling'

```

I made sure that I installed the latest version of the library

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [July 20, 2020, 12:06pm UTC](https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395/2 "2020-07-20T12:06:40Z")

</div>

Hi @krannnN, this change is recent not available in the release, you’ll need to install from source

---

<div class="post-metadata">

**Author:** ![krannnN](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@krannnN](https://discuss.huggingface.co/u/krannnN)\
**Post date:** [July 20, 2020, 12:09pm UTC](https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395/3 "2020-07-20T12:09:42Z")

</div>

Thank you this fixed it!  
I have one more question how I’m I suppose to split the raw data to train and test for this task ? the readme file for the language modeling example is a little bit outdated it doesn’t have any mention of xlnet, I know it’s added recently.

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [July 20, 2020, 2:41pm UTC](https://discuss.huggingface.co/t/cannot-import-data-collator-for-plm/395/4 "2020-07-20T14:41:00Z")

</div>

You’ll need to split the dataset yourself, you can just follow the 80-20 or 90-10% split depending on the number of examples in your dataset. So if your train files has 100 examples, then you can just take 20 examples from it and add them in the validation file. And you can pass the eval file using the `eval_data_file` argument. Hope this helps
