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
-
Upload folder using huggingface_hub (#2)
- e8ed5629da0a4861487b1bf8c5385fe71e808a2cb0f849ead36f407bb0fa0610 (362b0a43c7072b91db91b1ee8b7ed6504d6f7950) - 56f1ef29f3bed83fa1ea8accdfdc2df54607937df4d16f96c4a212d271bc719e (bc03a70628957bd2bcef99b484dbb725ee68f8a0) - 8f0df90739d90402b4a18c252948f915a3c0b46c5fdfd6d510d7915159500a0e (fe64689c6a0936356f559a37b495652377a87106) - 511604691ce5583b8f7941ce59eaab055fa54d147e23411a3435d4ce979dc2b4 (d5c2afa9f09c700b12546c6a142fdc541672de58) - 5ea8ae4b66c2b96996e5272ae2b832b94ce3e60aa5e3a41d71612240888e78be (dbccd320458764364f38210a19b99bb149a4f8ce) - d1be15f80ba9319496ee91217b3199fcef40726c0c0ec2a17342dd088bf3b9c4 (d6742168ec7a03e1f4d04c491e1a5043caa56362) - 2ef9e0e6fa270c62ec588ba8830c331f39bd830de3ccfb2cd683582006384a6c (abc5c3621e5f8997ea97734111553b9aece7d722) - 717c1316d0a17e651b6e09c8b79ff91fe04b3b2e3cf78e60b7f6f24996af85e7 (e827c6de5a4d77b3969c77abcf612ed70d3d4488) - 2af91306f926c3e84b6effb1fcb8d9bcfe67dfce5560bffa96cf3a1ef76c24da (cf4b70838282f7d27846532688b660b1800026f7) - 0b13ca37…b1d557c