Instructions to use aws-neuron/CodeLlama-7b-hf-neuron-8xlarge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aws-neuron/CodeLlama-7b-hf-neuron-8xlarge with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aws-neuron/CodeLlama-7b-hf-neuron-8xlarge")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aws-neuron/CodeLlama-7b-hf-neuron-8xlarge") model = AutoModelForCausalLM.from_pretrained("aws-neuron/CodeLlama-7b-hf-neuron-8xlarge", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aws-neuron/CodeLlama-7b-hf-neuron-8xlarge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aws-neuron/CodeLlama-7b-hf-neuron-8xlarge
- SGLang
How to use aws-neuron/CodeLlama-7b-hf-neuron-8xlarge 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 "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge" \ --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": "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge", "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 "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge" \ --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": "aws-neuron/CodeLlama-7b-hf-neuron-8xlarge", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aws-neuron/CodeLlama-7b-hf-neuron-8xlarge with Docker Model Runner:
docker model run hf.co/aws-neuron/CodeLlama-7b-hf-neuron-8xlarge
Commit History
-
9267ee116e0be22e44ffd4e55d05f19b5b9cfbabd1760bf07b6f38d5aa307710
f069ffa -
f30dfef0b32e688f7a1e8c8e728e734c9276ca18e5a205a6ef21bad7ea9bd541
7548fe9 -
74148c1005566e92c07022708b0cd9ee4c09b74c8c197fc829ef2a218973f201
64a4ac6 -
0b13ca37028a01945c617c1322d4f935ba0ccd820a899ae964fdd8f4631872ee
c5aeb91 -
defab67865fba11805e36a141c23ae2c30c9d68a48bf3cd8627425abe6e6ec40
acf79c6 -
2af91306f926c3e84b6effb1fcb8d9bcfe67dfce5560bffa96cf3a1ef76c24da
c6d8841 -
2ef9e0e6fa270c62ec588ba8830c331f39bd830de3ccfb2cd683582006384a6c
85a5e29 -
717c1316d0a17e651b6e09c8b79ff91fe04b3b2e3cf78e60b7f6f24996af85e7
50dad50 -
d1be15f80ba9319496ee91217b3199fcef40726c0c0ec2a17342dd088bf3b9c4
7babe08 -
511604691ce5583b8f7941ce59eaab055fa54d147e23411a3435d4ce979dc2b4
26b03ca -
5ea8ae4b66c2b96996e5272ae2b832b94ce3e60aa5e3a41d71612240888e78be
fc7fdc7 -
8f0df90739d90402b4a18c252948f915a3c0b46c5fdfd6d510d7915159500a0e
a4eaef1 -
e8ed5629da0a4861487b1bf8c5385fe71e808a2cb0f849ead36f407bb0fa0610
7f937da -
56f1ef29f3bed83fa1ea8accdfdc2df54607937df4d16f96c4a212d271bc719e
937078b -
initial commit
fc778cc