Merged Models
Collection
These are models created by merging existing models that are already fine tuned or even merged themselves. • 5 items • Updated • 1
How to use theprint/Code-Llama-Bagel-8B with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("theprint/Code-Llama-Bagel-8B", dtype="auto")How to use theprint/Code-Llama-Bagel-8B with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="theprint/Code-Llama-Bagel-8B", filename="Code-Llama-Bagel-8B.BF16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
How to use theprint/Code-Llama-Bagel-8B with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf theprint/Code-Llama-Bagel-8B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf theprint/Code-Llama-Bagel-8B:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf theprint/Code-Llama-Bagel-8B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf theprint/Code-Llama-Bagel-8B:Q4_K_M
# 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 theprint/Code-Llama-Bagel-8B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf theprint/Code-Llama-Bagel-8B:Q4_K_M
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 theprint/Code-Llama-Bagel-8B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf theprint/Code-Llama-Bagel-8B:Q4_K_M
docker model run hf.co/theprint/Code-Llama-Bagel-8B:Q4_K_M
How to use theprint/Code-Llama-Bagel-8B with Ollama:
ollama run hf.co/theprint/Code-Llama-Bagel-8B:Q4_K_M
How to use theprint/Code-Llama-Bagel-8B with Unsloth Studio:
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 theprint/Code-Llama-Bagel-8B to start chatting
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 theprint/Code-Llama-Bagel-8B to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for theprint/Code-Llama-Bagel-8B to start chatting
How to use theprint/Code-Llama-Bagel-8B with Docker Model Runner:
docker model run hf.co/theprint/Code-Llama-Bagel-8B:Q4_K_M
How to use theprint/Code-Llama-Bagel-8B with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull theprint/Code-Llama-Bagel-8B:Q4_K_M
lemonade run user.Code-Llama-Bagel-8B-Q4_K_M
lemonade list
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf theprint/Code-Llama-Bagel-8B:# Run inference directly in the terminal:
llama-cli -hf theprint/Code-Llama-Bagel-8B:# 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 theprint/Code-Llama-Bagel-8B:# Run inference directly in the terminal:
./llama-cli -hf theprint/Code-Llama-Bagel-8B: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 theprint/Code-Llama-Bagel-8B:# Run inference directly in the terminal:
./build/bin/llama-cli -hf theprint/Code-Llama-Bagel-8B:docker model run hf.co/theprint/Code-Llama-Bagel-8B:Code-Llama-Bagel-8B is a merge of the following models using LazyMergekit:
slices:
- sources:
- model: ajibawa-2023/Code-Llama-3-8B
layer_range: [0, 32]
- model: jondurbin/bagel-8b-v1.0
layer_range: [0, 32]
merge_method: slerp
base_model: ajibawa-2023/Code-Llama-3-8B
parameters:
t:
- filter: self_attn
value: [0, 0.5, 0.3, 0.7, 1]
- filter: mlp
value: [1, 0.5, 0.7, 0.3, 0]
- value: 0.5
dtype: bfloat16
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "theprint/Code-Llama-Bagel-8B"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 14.48 |
| IFEval (0-Shot) | 25.30 |
| BBH (3-Shot) | 25.34 |
| MATH Lvl 5 (4-Shot) | 4.98 |
| GPQA (0-shot) | 3.47 |
| MuSR (0-shot) | 7.53 |
| MMLU-PRO (5-shot) | 20.24 |
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf theprint/Code-Llama-Bagel-8B:# Run inference directly in the terminal: llama-cli -hf theprint/Code-Llama-Bagel-8B: