Instructions to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="afrideva/open_llama_3b_code_instruct_0.1-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("afrideva/open_llama_3b_code_instruct_0.1-GGUF", dtype="auto") - llama-cpp-python
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="afrideva/open_llama_3b_code_instruct_0.1-GGUF", filename="open_llama_3b_code_instruct_0.1.fp16.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 afrideva/open_llama_3b_code_instruct_0.1-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
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 afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
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 afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "afrideva/open_llama_3b_code_instruct_0.1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "afrideva/open_llama_3b_code_instruct_0.1-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
- SGLang
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF 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 "afrideva/open_llama_3b_code_instruct_0.1-GGUF" \ --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": "afrideva/open_llama_3b_code_instruct_0.1-GGUF", "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 "afrideva/open_llama_3b_code_instruct_0.1-GGUF" \ --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": "afrideva/open_llama_3b_code_instruct_0.1-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with Ollama:
ollama run hf.co/afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
- Unsloth Studio new
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF 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 afrideva/open_llama_3b_code_instruct_0.1-GGUF 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 afrideva/open_llama_3b_code_instruct_0.1-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for afrideva/open_llama_3b_code_instruct_0.1-GGUF to start chatting
- Docker Model Runner
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with Docker Model Runner:
docker model run hf.co/afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
- Lemonade
How to use afrideva/open_llama_3b_code_instruct_0.1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull afrideva/open_llama_3b_code_instruct_0.1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.open_llama_3b_code_instruct_0.1-GGUF-Q4_K_M
List all available models
lemonade list
mwitiderrick/open_llama_3b_code_instruct_0.1-GGUF
Quantized GGUF model files for open_llama_3b_code_instruct_0.1 from mwitiderrick
| Name | Quant method | Size |
|---|---|---|
| open_llama_3b_code_instruct_0.1.fp16.gguf | fp16 | 6.86 GB |
| open_llama_3b_code_instruct_0.1.q2_k.gguf | q2_k | 2.15 GB |
| open_llama_3b_code_instruct_0.1.q3_k_m.gguf | q3_k_m | 2.27 GB |
| open_llama_3b_code_instruct_0.1.q4_k_m.gguf | q4_k_m | 2.58 GB |
| open_llama_3b_code_instruct_0.1.q5_k_m.gguf | q5_k_m | 2.76 GB |
| open_llama_3b_code_instruct_0.1.q6_k.gguf | q6_k | 3.64 GB |
| open_llama_3b_code_instruct_0.1.q8_0.gguf | q8_0 | 3.64 GB |
Original Model Card:
OpenLLaMA Code Instruct: An Open Reproduction of LLaMA
This is an OpenLlama model that has been fine-tuned on 1 epoch of the AlpacaCode dataset (122K rows).
Prompt Template
### Instruction:
{query}
### Response:
<Leave new line for model to respond>
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM,pipeline
tokenizer = AutoTokenizer.from_pretrained("mwitiderrick/open_llama_3b_code_instruct_0.1")
model = AutoModelForCausalLM.from_pretrained("mwitiderrick/open_llama_3b_code_instruct_0.1")
query = "Write a quick sort algorithm in Python"
text_gen = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)
output = text_gen(f"### Instruction:\n{query}\n### Response:\n")
print(output[0]['generated_text'])
"""
### Instruction:
write a quick sort algorithm in Python
### Response:
def quick_sort(arr):
if len(arr) <= 1:
return arr
else:
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quick_sort(left) + middle + quick_sort(right)
arr = [5,2,4,3,1]
print(quick_sort(arr))
"""
[1, 2, 3, 4, 5]
"""
Metrics
| Tasks |Version|Filter|n-shot|Metric|Value | |Stderr|
|----------|-------|------|-----:|------|-----:|---|-----:|
|winogrande|Yaml |none | 0|acc |0.6267|± |0.0136|
|hellaswag|Yaml |none | 0|acc |0.4962|± |0.0050|
| | |none | 0|acc_norm|0.6581|± |0.0047|
|arc_challenge|Yaml |none | 0|acc |0.3481|± |0.0139|
| | |none | 0|acc_norm|0.3712|± |0.0141|
|truthfulqa|N/A |none | 0|bleu_max | 24.2580|± |0.5985|
| | |none | 0|bleu_acc | 0.2876|± |0.0003|
| | |none | 0|bleu_diff | -8.3685|± |0.6065|
| | |none | 0|rouge1_max | 49.3907|± |0.7350|
| | |none | 0|rouge1_acc | 0.2558|± |0.0002|
| | |none | 0|rouge1_diff|-10.6617|± |0.6450|
| | |none | 0|rouge2_max | 32.4189|± |0.9587|
| | |none | 0|rouge2_acc | 0.2142|± |0.0002|
| | |none | 0|rouge2_diff|-12.9903|± |0.9539|
| | |none | 0|rougeL_max | 46.2337|± |0.7493|
| | |none | 0|rougeL_acc | 0.2424|± |0.0002|
| | |none | 0|rougeL_diff|-11.0285|± |0.6576|
| | |none | 0|acc | 0.3072|± |0.0405|
- Downloads last month
- 82
Model tree for afrideva/open_llama_3b_code_instruct_0.1-GGUF
Base model
openlm-research/open_llama_3bDataset used to train afrideva/open_llama_3b_code_instruct_0.1-GGUF
Evaluation results
- hellaswag(0-Shot) on hellaswagself-reported0.658
- winogrande(0-Shot) on winograndeself-reported0.627
- arc_challenge(0-Shot) on arc_challengeopen_llama_3b_instruct_v_0.2 model card0.371