Instructions to use codellama/CodeLlama-13b-Python-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codellama/CodeLlama-13b-Python-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codellama/CodeLlama-13b-Python-hf")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codellama/CodeLlama-13b-Python-hf") model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-13b-Python-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codellama/CodeLlama-13b-Python-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codellama/CodeLlama-13b-Python-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codellama/CodeLlama-13b-Python-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codellama/CodeLlama-13b-Python-hf
- SGLang
How to use codellama/CodeLlama-13b-Python-hf 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 "codellama/CodeLlama-13b-Python-hf" \ --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": "codellama/CodeLlama-13b-Python-hf", "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 "codellama/CodeLlama-13b-Python-hf" \ --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": "codellama/CodeLlama-13b-Python-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codellama/CodeLlama-13b-Python-hf with Docker Model Runner:
docker model run hf.co/codellama/CodeLlama-13b-Python-hf
Commit History
-
Adding Evaluation Results
This is an automated PR created with https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr The purpose of this PR is to add evaluation results from the Open LLM Leaderboard to your model card. If you encounter any issues, please report them to https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr/discussions0bf40fe
-
Fix link to responsible use guide (#5)
- Fix link to responsible use guide (ef86a43386b4472275d9356e0891037d8f6f431b)e3ecb92
-
Update README.md
488587a -
CodeLlamaTokenizer (#4)
- CodeLlamaTokenizer (5a2b44a4393356da9bbf397746fab44261d270a3) Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>09a8678
-
Fix version description
5780576 -
Use and capabilities
175b416 -
Adding `safetensors` variant of this model (#3)
- Adding `safetensors` variant of this model (0d8bfb4b18a3f3cfb14eb1cad2752747f88c65e9)ea1b775 -
Update README.md
6afddcd -
Fix 13b and 34b instruct links (#1)
- Fix 13b and 34b instruct links (3ad562ce604342ea4918d1502412d7c826843d39)6fd299f
-
Upload 2 files
d911200 -
add model weights
dfefbd1 -
Create README.md
9e21efe -
initial commit
1f52ed4