Instructions to use EleutherAI/gpt-j-6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EleutherAI/gpt-j-6b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EleutherAI/gpt-j-6b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6b") model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EleutherAI/gpt-j-6b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EleutherAI/gpt-j-6b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/gpt-j-6b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EleutherAI/gpt-j-6b
- SGLang
How to use EleutherAI/gpt-j-6b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EleutherAI/gpt-j-6b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/gpt-j-6b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EleutherAI/gpt-j-6b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/gpt-j-6b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EleutherAI/gpt-j-6b with Docker Model Runner:
docker model run hf.co/EleutherAI/gpt-j-6b
Error Downloading Mdodel
While using git commands to download the model I am facing the following error
Cloning into 'gpt-j-6B'...
remote: Enumerating objects: 100, done.
remote: Counting objects: 100% (100/100), done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 100 (delta 46), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (100/100), 1.40 MiB | 1.22 MiB/s, done.
Resolving deltas: 100% (46/46), done.
Filtering content: 100% (3/3), 7.62 GiB | 5.15 MiB/s, done.
Encountered %!d(MISSING) file(s) that may not have been copied correctly on Windows:
flax_model.msgpack
tf_model.h5
pytorch_model.bin
See: `git lfs help smudge` for more details.
What happens when you run git lfs help smudge
"Sorry, no usage text found for "git-lfs"
I also tried
set GIT_LFS_SKIP_SMUDGE=1
git clone https://huggingface.co/EleutherAI/gpt-j-6B
but still get the same error.
Are you on Windows?
If you're not, Encountered %!d(MISSING) file(s) that may not have been copied correctly on Windows is just a warning.
If you are on Windows, I'm not 100% sure git-lfs works with >4GB files.... 😱
No, I am not on windows, I am using Ubuntu 18.
Does that mean that the required file is being downloaded and can be used? I used the same git-lfs command for GTP-neo-125M and it cloned without any errors and warnings.
yes, that's just a warning for Windows, you should be fine
@themessier Why don’t you try using the model and see if it works.
How do i use this module for a discord bot?