Instructions to use codellama/CodeLlama-34b-Python-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codellama/CodeLlama-34b-Python-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codellama/CodeLlama-34b-Python-hf")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codellama/CodeLlama-34b-Python-hf") model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-34b-Python-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codellama/CodeLlama-34b-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-34b-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-34b-Python-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codellama/CodeLlama-34b-Python-hf
- SGLang
How to use codellama/CodeLlama-34b-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-34b-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-34b-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-34b-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-34b-Python-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codellama/CodeLlama-34b-Python-hf with Docker Model Runner:
docker model run hf.co/codellama/CodeLlama-34b-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/discussions65d120d
-
Fix link to responsible use guide
0d7350d
-
Update README.md
a998a81 -
CodeLlamaTokenizer (#4)
- CodeLlamaTokenizer (97457c7ec0732316e402d4f88bab417a71b3d352) Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>5a4020f
-
Fix version description
411aa75 -
Use and capabilities
00dfeb7 -
Adding `safetensors` variant of this model (#3)
- Adding `safetensors` variant of this model (c4a3e0984501979a7d175d1f1497222714952c55)3dd8ab0 -
Update README.md
bf21d95 -
Fix 13b and 34b instruct links (#1)
- Fix 13b and 34b instruct links (3bca3497668a358dd252f9e40b3f56672ec4b2da)903aef2
-
Upload 2 files
53089b3 -
add model weights
ac60c79 -
Update README.md
dd41d5f -
initial commit
45fb8c7