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
add TF model
Browse files- config.json +9 -5
- tf_model.h5 +3 -0
config.json
CHANGED
|
@@ -13,24 +13,28 @@
|
|
| 13 |
"model_type": "gptj",
|
| 14 |
"n_embd": 4096,
|
| 15 |
"n_head": 16,
|
|
|
|
| 16 |
"n_layer": 28,
|
| 17 |
"n_positions": 2048,
|
|
|
|
| 18 |
"rotary": true,
|
| 19 |
"rotary_dim": 64,
|
|
|
|
| 20 |
"summary_activation": null,
|
| 21 |
"summary_first_dropout": 0.1,
|
| 22 |
"summary_proj_to_labels": true,
|
| 23 |
"summary_type": "cls_index",
|
| 24 |
"summary_use_proj": true,
|
| 25 |
-
"transformers_version": "4.10.0.dev0",
|
| 26 |
-
"tokenizer_class": "GPT2Tokenizer",
|
| 27 |
"task_specific_params": {
|
| 28 |
"text-generation": {
|
| 29 |
"do_sample": true,
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
}
|
| 33 |
},
|
|
|
|
|
|
|
|
|
|
| 34 |
"use_cache": true,
|
| 35 |
"vocab_size": 50400
|
| 36 |
-
}
|
|
|
|
| 13 |
"model_type": "gptj",
|
| 14 |
"n_embd": 4096,
|
| 15 |
"n_head": 16,
|
| 16 |
+
"n_inner": null,
|
| 17 |
"n_layer": 28,
|
| 18 |
"n_positions": 2048,
|
| 19 |
+
"resid_pdrop": 0.0,
|
| 20 |
"rotary": true,
|
| 21 |
"rotary_dim": 64,
|
| 22 |
+
"scale_attn_weights": true,
|
| 23 |
"summary_activation": null,
|
| 24 |
"summary_first_dropout": 0.1,
|
| 25 |
"summary_proj_to_labels": true,
|
| 26 |
"summary_type": "cls_index",
|
| 27 |
"summary_use_proj": true,
|
|
|
|
|
|
|
| 28 |
"task_specific_params": {
|
| 29 |
"text-generation": {
|
| 30 |
"do_sample": true,
|
| 31 |
+
"max_length": 50,
|
| 32 |
+
"temperature": 1.0
|
| 33 |
}
|
| 34 |
},
|
| 35 |
+
"tie_word_embeddings": false,
|
| 36 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 37 |
+
"transformers_version": "4.18.0.dev0",
|
| 38 |
"use_cache": true,
|
| 39 |
"vocab_size": 50400
|
| 40 |
+
}
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b99958d6ecfdab80e1feaa577a0750e247ed5129984f91d819aeac4bd5c9fb08
|
| 3 |
+
size 24203955064
|