Instructions to use ToastyPigeon/g3-12b-it-unalign with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ToastyPigeon/g3-12b-it-unalign with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ToastyPigeon/g3-12b-it-unalign") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ToastyPigeon/g3-12b-it-unalign") model = AutoModelForCausalLM.from_pretrained("ToastyPigeon/g3-12b-it-unalign") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ToastyPigeon/g3-12b-it-unalign with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ToastyPigeon/g3-12b-it-unalign" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToastyPigeon/g3-12b-it-unalign", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ToastyPigeon/g3-12b-it-unalign
- SGLang
How to use ToastyPigeon/g3-12b-it-unalign 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 "ToastyPigeon/g3-12b-it-unalign" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToastyPigeon/g3-12b-it-unalign", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ToastyPigeon/g3-12b-it-unalign" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToastyPigeon/g3-12b-it-unalign", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ToastyPigeon/g3-12b-it-unalign with Docker Model Runner:
docker model run hf.co/ToastyPigeon/g3-12b-it-unalign
g3-12b-it-unalign
This model is a fine-tuned version of unsloth/gemma-3-12b-it on the ToastyPigeon/unalign-v2 dataset. It achieves the following results on the evaluation set:
- Loss: 1.4684
So, it seems alright. I noticed however that the responses got pretty short at the end of the 2nd epoch. Not like, unusably short, but generally shorter than I personally like.
The epoch 1 test gguf is based on this commit.
I personally prefer epoch 1 to epoch 2, and will likely update this or make a second proper commit for epoch 1.
Update: I did indeed make a second commit for the epoch 1 checkpoint.
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 69
- optimizer: Use apollo_adamw_layerwise with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=proj=random,rank=1,scale=128.0,scale_type=tensor,update_proj_gap=200
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 5
- num_epochs: 2.0
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 7.8965 | 0.0118 | 1 | 6.4897 |
| 4.4934 | 0.2 | 17 | 4.0497 |
| 3.9523 | 0.4 | 34 | 3.7484 |
| 3.5624 | 0.6 | 51 | 3.3152 |
| 2.7168 | 0.8 | 68 | 2.4773 |
| 2.1303 | 1.0 | 85 | 1.9483 |
| 1.8215 | 1.2 | 102 | 1.7577 |
| 1.7199 | 1.4 | 119 | 1.6561 |
| 1.5771 | 1.6 | 136 | 1.5611 |
| 1.5599 | 1.8 | 153 | 1.5124 |
| 1.4831 | 2.0 | 170 | 1.4684 |
Framework versions
- Transformers 4.50.0.dev0
- Pytorch 2.5.1+cu124
- Datasets 3.4.1
- Tokenizers 0.21.1
- Downloads last month
- 5