# Lower Memory Usage for TF GPT-J

**URL:** <https://discuss.huggingface.co/t/lower-memory-usage-for-tf-gpt-j/18058>\
**Category:** 🤗Transformers\
**Created:** [May 17, 2022, 2:54pm UTC](https://discuss.huggingface.co/t/lower-memory-usage-for-tf-gpt-j/18058 "2022-05-17T14:54:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyyim](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@tyyim](https://discuss.huggingface.co/u/tyyim)\
**Post date:** [May 17, 2022, 2:54pm UTC](https://discuss.huggingface.co/t/lower-memory-usage-for-tf-gpt-j/18058/1 "2022-05-17T14:54:38Z")

</div>

We can use this way of lowering the memory usage for PT but how about Tensorflow?

```auto
from transformers import GPTJForCausalLM
import torch

model = GPTJForCausalLM.from_pretrained(
    "EleutherAI/gpt-j-6B", revision="float16", torch_dtype=torch.float16, low_cpu_mem_usage=True
)

```

Seems like both the “revision” and the “low\_cpu\_mem\_usage” parameters do not exist in TF.

May I know whether there is any technique I can use to lower the memory usage for TF as my 3090 cannot load the GPT-J-6B model?

---

<div class="post-metadata">

**Author:** ![LeoLee92](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@LeoLee92](https://discuss.huggingface.co/u/LeoLee92)\
**Post date:** [May 7, 2024, 5:07am UTC](https://discuss.huggingface.co/t/lower-memory-usage-for-tf-gpt-j/18058/2 "2024-05-07T05:07:36Z")

</div>

Did you get to know how to use “low\_mem\_usage” in Tensorflow?
