Instructions to use ego-hf/CodeLlama-7b-Python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ego-hf/CodeLlama-7b-Python with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ego-hf/CodeLlama-7b-Python", filename="ggml-model-f32-00001-of-00010.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ego-hf/CodeLlama-7b-Python with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ego-hf/CodeLlama-7b-Python:F32 # Run inference directly in the terminal: llama-cli -hf ego-hf/CodeLlama-7b-Python:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ego-hf/CodeLlama-7b-Python:F32 # Run inference directly in the terminal: llama-cli -hf ego-hf/CodeLlama-7b-Python:F32
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ego-hf/CodeLlama-7b-Python:F32 # Run inference directly in the terminal: ./llama-cli -hf ego-hf/CodeLlama-7b-Python:F32
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ego-hf/CodeLlama-7b-Python:F32 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ego-hf/CodeLlama-7b-Python:F32
Use Docker
docker model run hf.co/ego-hf/CodeLlama-7b-Python:F32
- LM Studio
- Jan
- Ollama
How to use ego-hf/CodeLlama-7b-Python with Ollama:
ollama run hf.co/ego-hf/CodeLlama-7b-Python:F32
- Unsloth Studio new
How to use ego-hf/CodeLlama-7b-Python with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ego-hf/CodeLlama-7b-Python to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ego-hf/CodeLlama-7b-Python to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ego-hf/CodeLlama-7b-Python to start chatting
- Docker Model Runner
How to use ego-hf/CodeLlama-7b-Python with Docker Model Runner:
docker model run hf.co/ego-hf/CodeLlama-7b-Python:F32
- Lemonade
How to use ego-hf/CodeLlama-7b-Python with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ego-hf/CodeLlama-7b-Python:F32
Run and chat with the model
lemonade run user.CodeLlama-7b-Python-F32
List all available models
lemonade list
| license: llama2 | |
| base_model: meta-llama/CodeLlama-7b-Python-hf | |
| model_name: CodeLlama-7b-Python GGUF | |
| model_type: llama | |
| language: | |
| - code | |
| tags: | |
| - LLM | |
| - llama2 | |
| - llama-2 | |
| - CodeLlama | |
| - CodeLlama-Python | |
| - CodeLlama-7B-Python | |
| - lama.cpp | |
| - Python | |
| - 7B | |
| # Model Card: Meta CodeLlama-7b-Python gguf | |
| Origin Meta model [CodeLlama-7b-Python](https://llama.meta.com/llama-downloads/), [code llama large language model coding](https://ai.meta.com/blog/code-llama-large-language-model-coding/), [codellama](https://github.com/meta-llama/codellama) converted into gguf format with [llama.cpp](https://github.com/ggerganov/llama.cpp) | |
| *Licen*: "Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved." | |
| [Policy](https://llama.meta.com/use-policy/) | |
| # Run model | |
| ```bash | |
| ./main -m ggml-model-f32-00001-of-00010.gguf -p "def fibonacci(" | |
| ``` | |
| ## Convert to gguf | |
| ```bash | |
| python3 convert.py ../codellama/CodeLlama-7b-Python | |
| ``` | |
| ## Split Model | |
| Original Meta `CodeLlama-7b-Python` model converted with [python3 convert.py](https://github.com/ggerganov/llama.cpp) to `gguf` and | |
| `CodeLlama-7b-Python/ggml-model-f32.gguf` and splitted with [gguf-split](https://github.com/ggerganov/llama.cpp) to smaller size chunks up to `split-max-tensors 32`. | |
| ```bash | |
| python3 convert.py ../codellama/CodeLlama-7b-Python | |
| ./gguf-split --split --split-max-tensors 32 ./models/CodeLlama-7b-Python/ggml-model-f32.gguf ./models/CodeLlama-7b-Python/ggml-model-f32 | |
| ``` | |
| ## Merge-back model use | |
| ```bash | |
| ./gguf-split --merge ggml-model-f32-00001-of-00010.gguf ggml-model-f32.gguf | |
| ``` | |