# Not able to use electra model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-able-to-use-electra-model%2F36325%3E%5C
**Category:** 🤗Transformers\
**Created:** [April 12, 2023, 9:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-able-to-use-electra-model%2F36325 "2023-04-12T09:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harish-Tricon](https://avatars.discourse-cdn.com/v4/letter/h/b487fb/32.png) [@Harish-Tricon](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FHarish-Tricon)%5C
**Post date:** [April 12, 2023, 9:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnot-able-to-use-electra-model%2F36325%2F1 "2023-04-12T09:40:59Z")

</div>

I am using the “google/electra-base-discriminator” model like below,

**model = ElectraForPreTraining.from\_pretrained(“google/electra-base-discriminator”)**  
**tokenizer = ElectraTokenizerFast.from\_pretrained(“google/electra-base-discriminator”)**

but facing the below error:

**Unable to load weights from pytorch checkpoint file for 'C:\Users\Prajapati.Kishor/.cache\huggingface\hub\models–google–electra-base-discriminator\snaps**  
**hots\1b48ef100dac4676d84125a8a7b7ab7c51e00386\pytorch\_model.bin’ at 'C:\Users\Prajapati.Kishor/.cache\huggingface\hub\models–google–electra-base-discriminator\sn**  
**apshots\1b48ef100dac4676d84125a8a7b7ab7c51e00386\pytorch\_model.bin’. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from\_tf=True.**

I also tried by using from\_tf=True, like below:

**model = ElectraForPreTraining.from\_pretrained(“google/electra-base-discriminator”,from\_tf=True)**  
**tokenizer = ElectraTokenizerFast.from\_pretrained(“google/electra-base-discriminator”,from\_tf=True)**

but I am facing the below issue:  
**File “h5py\h5f.pyx”, line 106, in h5py.h5f.open**  
**OSError: Unable to open file (truncated file: eof = 45749007, sblock-\>base\_addr = 0, stored\_eof = 438200172)**
