Text Generation
Transformers
Safetensors
English
llama
meta
llama-3
conversational
text-generation-inference
Instructions to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gradientai/Llama-3-8B-Instruct-Gradient-1048k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gradientai/Llama-3-8B-Instruct-Gradient-1048k") model = AutoModelForCausalLM.from_pretrained("gradientai/Llama-3-8B-Instruct-Gradient-1048k", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gradientai/Llama-3-8B-Instruct-Gradient-1048k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k
- SGLang
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k 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 "gradientai/Llama-3-8B-Instruct-Gradient-1048k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "gradientai/Llama-3-8B-Instruct-Gradient-1048k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with Docker Model Runner:
docker model run hf.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k
Commit History
-
Update README.md
Verified signaturecd3069b
-
Update README.md
Verified signature84c083a
-
Add NIAH eval results
Verified signature8697fb2
-
Update README.md
Verified signature41e3fb8
-
Update README.md
Verified signaturea604554
-
Update README.md
Verified signature7449cf9 -
Update config.json
Verified signature23fdb98 -
Update README.md
Verified signature46e7c2f -
Update README.md (#15)
Verified signature- Update README.md (94f7ba2d76c1644875a50aedcb774cf16d3ef0ca) Co-authored-by: Leo Pekelis <leo-pekelis-gradient@users.noreply.huggingface.co>9e8091a -
Update instruction weights (#14)
Verified signature- Update weights (a4895fdd950ac2f81bbb9732beb20147e3171800) - Delete model-00002-of-00004.safetensors (97a478ecb4f8e73027d7caac79dda0d79b42e7d8) - Delete model-00004-of-00004.safetensors (8ffaa64c434541cca36280ef75ea1d0f092800b0) - Delete model-00003-of-00004.safetensors (615f8f08cdcce161dfa50cba6f1e021ef81b21d5) - Upload model-00004-of-00004.safetensors (c64659da8352f246989bcdc9086260b299e6759d) - Upload 3 files (b94f104ee534e65678afcccb43db25620ec1e5bf)8bb6d18
-
Update README.md (#13)
Verified signature- Update README.md (0eac4d2059c15988de0624a0aa2024dea3fd75f2)909ddf7
-
Update README.md
Verified signatureeadf5aa
-
Update README.md
Verified signature1c075c4 -
Update README.md
Verified signature69e6264 -
Update README.md
Verified signature2ed1903 -
Update %
Verified signaturec64956e -
Update num tokens trained + typo
Verified signatured336d0c -
Update README.md
Verified signatured28c987 -
Update README.md
Verified signature51a5569 -
Update README.md (#3)
Verified signature- Update README.md (5e0dac3a0f38a8d3408b4b6f6c582e461561ab16)c155d16 -
Update logo to link to website
Verified signature5ebdef2 -
Update README.md
Verified signature5861db3 -
Update README.md
Verified signature698e052 -
Update README.md
Verified signature404ab0b -
Update README.md
Verified signaturedf6e96a -
Create README.md
Verified signature848a82c -
Create License
Verified signature6bff764 -
Update config.json
Verified signaturef64e699 -
Uploading model (#1)
Verified signature- Uploading model (0be6297dbe822ce4c3868f010950ea015c56ec18)89f0785 -
initial commit
Verified signature9d85cc4