# NotImplementedError: Cannot copy out of meta tensor; no data!

**URL:** <https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542>\
**Category:** 🤗Transformers\
**Created:** [May 31, 2023, 1:23am UTC](https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542 "2023-05-31T01:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anujsahani01](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujsahani01](https://discuss.huggingface.co/u/anujsahani01)\
**Post date:** [May 31, 2023, 1:23am UTC](https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542/1 "2023-05-31T01:23:23Z")

</div>

I am finetuning hugging face “HuggingFaceH4/starchat-alpha” model for making a data science text to code generating bot.  
This is the format of my dataset:  
train: Dataset({  
features: [‘input\_ids’, ‘labels’],  
num\_rows: 5012  
})  
test: Dataset({  
features: [‘input\_ids’, ‘labels’],  
num\_rows: 1325  
})  
})  
and the structure of the dataset looks somewhat like this, which was explained in starcoder documentation,  
\<|system|\>  
Below is a dialogue between a human and an ANUJ\_AI  
\<|end|\>  
\<|user|\>  
Minimum count of ind… so on  
\<|end|\>  
\<|assistant|\>  
def possible ( x , S , N ) : …so on  
\<|end|\>

I am loading the model on my colab in 8 bit format using 🤗transformer BitsAndBytesConfig for saving memory, then loaded the model using a device map which was made using 🤗 transformers AutoConfig and the acclerate which divided my model amoung ‘gpu’, ‘cpu’ RAM and my ‘disk’.

Once the model and its checkpoints were downloaded successfully then i used transformers.Trainer to train the model on my custom dataset.  
my using the below code:  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/3/431c0772307c120ba079d7b16c599750b0d05f29.png)  
but i am always getting this error =:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/d/1/d1ca970cf62eedb3965876c3eccf9a93d3edd886.png)

Please help me out with this error, if anyone has prior experience in this.  
Your inputs will be highly appreciated.  
Thank You!

---

<div class="post-metadata">

**Author:** ![wonderfullymade](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wonderfullymade](https://discuss.huggingface.co/u/wonderfullymade)\
**Post date:** [February 21, 2024, 3:54pm UTC](https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542/2 "2024-02-21T15:54:31Z")

</div>

i’m having the same issue, have you found a solution?

---

<div class="post-metadata">

**Author:** ![Dionick](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@Dionick](https://discuss.huggingface.co/u/Dionick)\
**Post date:** [April 10, 2024, 9:43am UTC](https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542/3 "2024-04-10T09:43:22Z")

</div>

same issue here, please reply if you find any solution!

---

<div class="post-metadata">

**Author:** ![saeed899](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@saeed899](https://discuss.huggingface.co/u/saeed899)\
**Post date:** [January 4, 2025, 10:32pm UTC](https://discuss.huggingface.co/t/notimplementederror-cannot-copy-out-of-meta-tensor-no-data/41542/4 "2025-01-04T22:32:51Z")

</div>

Still facing this issue.
