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 (#1)
- 56f1ef29f3bed83fa1ea8accdfdc2df54607937df4d16f96c4a212d271bc719e (937078bbdfe9bc03350259975835f7b5e815824f) - e8ed5629da0a4861487b1bf8c5385fe71e808a2cb0f849ead36f407bb0fa0610 (7f937daa17ae0c6808bcd7997a32bf2c545835b6) - 8f0df90739d90402b4a18c252948f915a3c0b46c5fdfd6d510d7915159500a0e (a4eaef1919726bb2666c85704b1c04ab4776235a) - 5ea8ae4b66c2b96996e5272ae2b832b94ce3e60aa5e3a41d71612240888e78be (fc7fdc7bd1d0a989e3720842b4162f2bed897fd2) - 511604691ce5583b8f7941ce59eaab055fa54d147e23411a3435d4ce979dc2b4 (26b03ca3f7edc7b47516e9b71002eafb4c0c50a8) - d1be15f80ba9319496ee91217b3199fcef40726c0c0ec2a17342dd088bf3b9c4 (7babe088a669a761adbe622b2566237fb9e3511e) - 717c1316d0a17e651b6e09c8b79ff91fe04b3b2e3cf78e60b7f6f24996af85e7 (50dad50c70fbbf83a3bf1e5701daf2e276a6eece) - 2ef9e0e6fa270c62ec588ba8830c331f39bd830de3ccfb2cd683582006384a6c (85a5e29e11ddc7a48da2c50fea533dd4fd1aeb81) - 2af91306f926c3e84b6effb1fcb8d9bcfe67dfce5560bffa96cf3a1ef76c24da (c6d884168e77983daa56c4030ea9d7417c50063b) - defab678…4201456