Instructions to use QuantFactory/gemma-2-9b-it-SimPO-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/gemma-2-9b-it-SimPO-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/gemma-2-9b-it-SimPO-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 QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/gemma-2-9b-it-SimPO-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 QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use QuantFactory/gemma-2-9b-it-SimPO-GGUF with Ollama:
ollama run hf.co/QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/gemma-2-9b-it-SimPO-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 QuantFactory/gemma-2-9b-it-SimPO-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 QuantFactory/gemma-2-9b-it-SimPO-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/gemma-2-9b-it-SimPO-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/gemma-2-9b-it-SimPO-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/gemma-2-9b-it-SimPO-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/gemma-2-9b-it-SimPO-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.gemma-2-9b-it-SimPO-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
|
| 4 |
+
base_model: google/gemma-2-9b-it
|
| 5 |
+
tags:
|
| 6 |
+
- alignment-handbook
|
| 7 |
+
- generated_from_trainer
|
| 8 |
+
datasets:
|
| 9 |
+
- princeton-nlp/gemma2-ultrafeedback-armorm
|
| 10 |
+
model-index:
|
| 11 |
+
- name: princeton-nlp/gemma-2-9b-it-SimPO
|
| 12 |
+
results: []
|
| 13 |
+
license: mit
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
|
| 19 |
+
# QuantFactory/gemma-2-9b-it-SimPO-GGUF
|
| 20 |
+
This is quantized version of [princeton-nlp/gemma-2-9b-it-SimPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-SimPO) created using llama.cpp
|
| 21 |
+
|
| 22 |
+
# Original Model Card
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
# gemma-2-9b-it-SimPO Model Card
|
| 26 |
+
|
| 27 |
+
SimPO (Simple Preference Optimization) is an offline preference optimization algorithm designed to enhance the training of large language models (LLMs) with preference optimization datasets. SimPO aligns the reward function with the generation likelihood, eliminating the need for a reference model and incorporating a target reward margin to boost performance. Please refer to our [preprint](https://arxiv.org/pdf/2405.14734) and [github repo](https://github.com/princeton-nlp/SimPO) for more details.
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Model Details
|
| 31 |
+
|
| 32 |
+
### Model Description
|
| 33 |
+
|
| 34 |
+
We fine-tuned [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) on [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) with the SimPO objective.
|
| 35 |
+
|
| 36 |
+
- **Developed by:** Yu Meng, Mengzhou Xia, Danqi Chen
|
| 37 |
+
- **Model type:** Causal Language Model
|
| 38 |
+
- **License:** gemma
|
| 39 |
+
- **Finetuned from model:** [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it)
|
| 40 |
+
|
| 41 |
+
### Model Sources
|
| 42 |
+
|
| 43 |
+
<!-- Provide the basic links for the model. -->
|
| 44 |
+
|
| 45 |
+
- **Repository:** https://github.com/princeton-nlp/SimPO
|
| 46 |
+
- **Paper:** https://arxiv.org/pdf/2405.14734
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
## How to Get Started with the Model
|
| 50 |
+
```
|
| 51 |
+
import torch
|
| 52 |
+
from transformers import pipeline
|
| 53 |
+
|
| 54 |
+
model_id = "princeton-nlp/gemma-2-9b-it-SimPO"
|
| 55 |
+
|
| 56 |
+
generator = pipeline(
|
| 57 |
+
"text-generation",
|
| 58 |
+
model=model_id,
|
| 59 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 60 |
+
device="cuda",
|
| 61 |
+
)
|
| 62 |
+
outputs = generator([{"role": "user", "content": "What's the difference between llamas and alpacas?"}], do_sample=False, max_new_tokens=200)
|
| 63 |
+
print(outputs[0]['generated_text'])
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Training Details
|
| 67 |
+
|
| 68 |
+
### Training Data
|
| 69 |
+
|
| 70 |
+
We use [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) as the preference optimization dataset.
|
| 71 |
+
|
| 72 |
+
#### Training Hyperparameters
|
| 73 |
+
|
| 74 |
+
The hyperparameters used can be found in the [training script](https://github.com/princeton-nlp/SimPO/blob/main/training_configs/gemma-2-9b-it-simpo.yaml).
|
| 75 |
+
|
| 76 |
+
#### Speeds, Sizes, Times
|
| 77 |
+
|
| 78 |
+
Fine-tuning the [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) on [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) takes around 100 mins to finish on 8xH100 GPUs.
|
| 79 |
+
|
| 80 |
+
## Evaluation Results
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
| models | AE2 LC | AE2 WR | AE2 Length | AH | AH Length | GSM | GSM Length | MMLU | MMLU Length |
|
| 84 |
+
|-----------------------------------|:------:|:------:|:----------:|:----:|:---------:|:----:|:----------:|:----:|:-----------:|
|
| 85 |
+
| [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) | 51.1 | 38.1 | 1571 | 40.8 | 545 | 87.4 | 395 | 72.7 | 515 |
|
| 86 |
+
| [princeton-nlp/gemma-2-9b-it-DPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-DPO) | 67.8 | 65.4 | 2016 | 58.9 | 717 | 88.5 | 392 | 72.2 | 624 |
|
| 87 |
+
| [princeton-nlp/gemma-2-9b-it-SimPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-SimPO) | 72.4 | 65.9 | 1833 | 59.1 | 693 | 88.0 | 341 | 72.2 | 441 |
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
## Technical Specifications
|
| 91 |
+
|
| 92 |
+
### Model Architecture and Objective
|
| 93 |
+
|
| 94 |
+
The model architecture is based on [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it). We use the SimPO training objective proposed in our [preprint](https://arxiv.org/pdf/2405.14734).
|
| 95 |
+
|
| 96 |
+
#### Hardware
|
| 97 |
+
|
| 98 |
+
We used 8xH100 GPUs for model training.
|
| 99 |
+
|
| 100 |
+
#### Software
|
| 101 |
+
|
| 102 |
+
Training was done using the [alignment-handbook](https://github.com/huggingface/alignment-handbook) library.
|
| 103 |
+
|
| 104 |
+
## Citation
|
| 105 |
+
|
| 106 |
+
gemma model:
|
| 107 |
+
```
|
| 108 |
+
@article{gemma_2024,
|
| 109 |
+
title={Gemma},
|
| 110 |
+
url={https://www.kaggle.com/m/3301},
|
| 111 |
+
DOI={10.34740/KAGGLE/M/3301},
|
| 112 |
+
publisher={Kaggle},
|
| 113 |
+
author={Gemma Team},
|
| 114 |
+
year={2024}
|
| 115 |
+
}
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
SimPO paper:
|
| 119 |
+
```
|
| 120 |
+
@article{meng2024simpo,
|
| 121 |
+
title={{SimPO}: Simple preference optimization with a reference-free reward},
|
| 122 |
+
author={Meng, Yu and Xia, Mengzhou and Chen, Danqi},
|
| 123 |
+
journal={arXiv preprint arXiv:2405.14734},
|
| 124 |
+
year={2024}
|
| 125 |
+
}
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
UltraFeedback paper:
|
| 129 |
+
```
|
| 130 |
+
@article{cui2023ultrafeedback,
|
| 131 |
+
title={{UltraFeedback}: Boosting language models with high-quality feedback},
|
| 132 |
+
author={Cui, Ganqu and Yuan, Lifan and Ding, Ning and Yao, Guanming and Zhu, Wei and Ni, Yuan and Xie, Guotong and Liu, Zhiyuan and Sun, Maosong},
|
| 133 |
+
journal={arXiv preprint arXiv:2310.01377},
|
| 134 |
+
year={2023}
|
| 135 |
+
}
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
ArmoRM paper:
|
| 139 |
+
```
|
| 140 |
+
@article{wang2024interpretable,
|
| 141 |
+
title={Interpretable Preferences via Multi-Objective Reward Modeling and Mixture-of-Experts},
|
| 142 |
+
author={Wang, Haoxiang and Xiong, Wei and Xie, Tengyang and Zhao, Han and Zhang, Tong},
|
| 143 |
+
journal={arXiv preprint arXiv:2406.12845},
|
| 144 |
+
year={2024}
|
| 145 |
+
}
|
| 146 |
+
```
|