Instructions to use LoneStriker/Gemmalpaca-2B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LoneStriker/Gemmalpaca-2B-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LoneStriker/Gemmalpaca-2B-GGUF", dtype="auto") - llama-cpp-python
How to use LoneStriker/Gemmalpaca-2B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="LoneStriker/Gemmalpaca-2B-GGUF", filename="Gemmalpaca-2B-Q3_K_L.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 LoneStriker/Gemmalpaca-2B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf LoneStriker/Gemmalpaca-2B-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 LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf LoneStriker/Gemmalpaca-2B-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 LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf LoneStriker/Gemmalpaca-2B-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 LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use LoneStriker/Gemmalpaca-2B-GGUF with Ollama:
ollama run hf.co/LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M
- Unsloth Studio new
How to use LoneStriker/Gemmalpaca-2B-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 LoneStriker/Gemmalpaca-2B-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 LoneStriker/Gemmalpaca-2B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for LoneStriker/Gemmalpaca-2B-GGUF to start chatting
- Docker Model Runner
How to use LoneStriker/Gemmalpaca-2B-GGUF with Docker Model Runner:
docker model run hf.co/LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M
- Lemonade
How to use LoneStriker/Gemmalpaca-2B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LoneStriker/Gemmalpaca-2B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Gemmalpaca-2B-GGUF-Q4_K_M
List all available models
lemonade list
Gemmalpaca-2B
This is gemma-2b model supervised fine-tuned on the vicgalle/alpaca-gpt4 dataset. It outperforms gemma-2b-it, Google's chat version, on Nous' benchmark suite.
It's mostly a test to see how fine-tuning works with Gemma models on a well-known dataset. It turned out better than expected. :)
🔍 Applications
This model has a context length of 8k. I recommend using it with the Alpaca chat template and NOT the Gemma Instruct template (works perfectly with LM Studio). You also want to add </s> as a stop token.
⚡ Quantized models
🏆 Evaluation
Nous
Gemmalpaca-2B outperforms gemma-2b and gemma-2b-it on Nous' benchmark suite (evaluation performed using LLM AutoEval). See the entire leaderboard here.
| Model | Average | AGIEval | GPT4All | TruthfulQA | Bigbench |
|---|---|---|---|---|---|
| mlabonne/Gemmalpaca-2B 📄 | 38.39 | 24.48 | 51.22 | 47.02 | 30.85 |
| google/gemma-2b-it 📄 | 36.1 | 23.76 | 43.6 | 47.64 | 29.41 |
| google/gemma-2b 📄 | 34.26 | 22.7 | 43.35 | 39.96 | 31.03 |
🧩 Configuration
It was trained using Axolotl with the following configuration.
base_model: alpindale/gemma-2b
model_type: GemmaForCausalLM
tokenizer_type: GemmaTokenizer
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
- path: vicgalle/alpaca-gpt4
type: alpaca
dataset_prepared_path:
val_set_size: 0.01
output_dir: ./out
sequence_len: 2048
sample_packing: true
pad_to_sequence_len: true
adapter: qlora
lora_model_dir:
lora_r: 32
lora_alpha: 64
lora_dropout: 0.05
lora_target_linear: true
wandb_project: axolotl
wandb_entity:
wandb_watch:
wandb_name:
wandb_log_model:
gradient_accumulation_steps: 4
micro_batch_size: 2
num_epochs: 3
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.0002
train_on_inputs: false
group_by_length: false
bf16: auto
fp16:
tf32: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention:
warmup_steps: 10
evals_per_epoch: 4
eval_table_size:
eval_table_max_new_tokens: 128
saves_per_epoch: 1
debug:
deepspeed:
weight_decay: 0.1
fsdp:
fsdp_config:
special_tokens:
bos_token: <s>
eos_token: </s>
unk_token: <unk>
- Downloads last month
- 43
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for LoneStriker/Gemmalpaca-2B-GGUF
Base model
google/gemma-2b