# How to get word embeddings for Flax model?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-get-word-embeddings-for-flax-model%2F21295%3E%5C
**Category:** Flax/JAX Projects\
**Created:** [August 5, 2022, 8:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-get-word-embeddings-for-flax-model%2F21295 "2022-08-05T20:49:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aryan1107](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/aryan1107/32/5600_2.png) [@aryan1107](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faryan1107)%5C
**Post date:** [August 5, 2022, 8:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-get-word-embeddings-for-flax-model%2F21295%2F1 "2022-08-05T20:49:31Z")

</div>

For example `model.bert.embeddings.weight` gives us embeddings for my model which is:

```auto
model = TFBertForQuestionAnswering.from_pretrained("deepset/bert-base-cased-squad2", from_pt=True)

```

Similarly I am working on Flax model and it doesn’t has that method: my flax model is something like this:

```auto
model = FlaxBertForQuestionAnswering.from_pretrained('mrm8488/bert-multi-cased-finedtuned-xquad-tydiqa-goldp')

```

---

<div class="post-metadata">

**Author:** ![kylemai](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kylemai](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkylemai)%5C
**Post date:** [August 25, 2022, 9:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-get-word-embeddings-for-flax-model%2F21295%2F2 "2022-08-25T09:51:24Z")

</div>

The word embeddings for flax model is: model.params[“transformer”][“wte”][“embedding”]
