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
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,20 +1,48 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
tags:
|
| 4 |
- LLM
|
| 5 |
- CodeLlama
|
|
|
|
| 6 |
- lama.cpp
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
# Model Card: CodeLlama-7b-Python gguf
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
Original Meta `CodeLlama-7b-Python` model converted with [python3 convert.py](https://github.com/ggerganov/llama.cpp) to `gguf` and
|
| 14 |
`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`.
|
| 15 |
|
| 16 |
```bash
|
| 17 |
python3 convert.py ../codellama/CodeLlama-7b-Python
|
| 18 |
-
|
| 19 |
./gguf-split --split --split-max-tensors 32 ./models/CodeLlama-7b-Python/ggml-model-f32.gguf ./models/CodeLlama-7b-Python/ggml-model-f32
|
| 20 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: llama2
|
| 3 |
tags:
|
| 4 |
- LLM
|
| 5 |
- CodeLlama
|
| 6 |
+
- CodeLlama-7b-Python
|
| 7 |
- lama.cpp
|
| 8 |
+
- Python
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Model Card: Meta CodeLlama-7b-Python gguf
|
| 12 |
|
| 13 |
+
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)
|
| 14 |
+
|
| 15 |
+
*Licen*: "Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved."
|
| 16 |
+
|
| 17 |
+
[Policy](https://llama.meta.com/use-policy/)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Run model
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
./main -m ggml-model-f32-00001-of-00010.gguf -p "def fibonacci("
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
## Convert to gguf
|
| 28 |
+
```bash
|
| 29 |
+
python3 convert.py ../codellama/CodeLlama-7b-Python
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## Split Model
|
| 34 |
|
| 35 |
Original Meta `CodeLlama-7b-Python` model converted with [python3 convert.py](https://github.com/ggerganov/llama.cpp) to `gguf` and
|
| 36 |
`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`.
|
| 37 |
|
| 38 |
```bash
|
| 39 |
python3 convert.py ../codellama/CodeLlama-7b-Python
|
|
|
|
| 40 |
./gguf-split --split --split-max-tensors 32 ./models/CodeLlama-7b-Python/ggml-model-f32.gguf ./models/CodeLlama-7b-Python/ggml-model-f32
|
| 41 |
```
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
## Merge-back model use
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
./gguf-split --merge ggml-model-f32-00001-of-00010.gguf ggml-model-f32.gguf
|
| 48 |
+
```
|