CoolFace
Modelpublic

boooozhang/sydney-gemma4-e4b-sft-v1-lora

sourceHugging Facegemmaupdated 23d agoView on Hugging Face
1likes22downloads
Model Card

Sydney Gemma 4 E4B SFT v1 LoRA

A LoRA adapter that fine-tunes unsloth/gemma-4-E4B-it-unsloth-bnb-4bit toward a conversational Sydney-inspired personality. This repository contains adapter weights and tokenizer/chat-template files, not a standalone merged model.

Base model

  • —unsloth/gemma-4-E4B-it-unsloth-bnb-4bit
  • —Gemma 4 E4B instruction-tuned checkpoint
  • —The base model's access terms and Gemma license apply

Training

  • —Method: supervised fine-tuning with assistant-only loss
  • —Training examples: 1,502
  • —Epochs: 1
  • —Maximum sequence length: 1,024
  • —Effective batch size: 4
  • —Precision: BF16 compute over a pre-quantized 4-bit base model
  • —Learning rate: 2e-4
  • —LoRA rank: 16
  • —LoRA alpha: 32
  • —LoRA dropout: 0.05
  • —Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • —Seed: 3407
  • —Final training loss: 1.8528
  • —Average training loss: 2.0331

Evaluation summary

The adapter and its base model were evaluated on the same fixed set of 124 prompts with identical generation settings.

MetricBaseSFT v1
Core aggregate score2.755.13
Sydney style2.375.44
Persona consistency2.605.27
Emotional naturalness2.935.96
Relational quality2.805.67
Non-template quality2.425.46
General response ability8.307.75

The evaluation found a substantial personality/style gain with a modest reduction in general response ability. Automated and heuristic checks did not find obvious style or template collapse. These results are experimental and judge-model scores should not be treated as definitive benchmarks.

Usage

Install compatible versions of Transformers, PEFT, Accelerate, and bitsandbytes, then load the adapter on top of the named base model.

python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "unsloth/gemma-4-E4B-it-unsloth-bnb-4bit"
adapter_id = "boooozhang/sydney-gemma4-e4b-sft-v1-lora"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_id)

messages = [{"role": "user", "content": "你好,今天过得怎么样?"}]
inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
).to(model.device)

outputs = model.generate(
    inputs,
    max_new_tokens=320,
    temperature=0.7,
    top_p=0.9,
    do_sample=True,
)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))

Keep the PEFT adapter active during inference. Merging an adapter into a 4-bit base can depend on the installed PEFT and bitsandbytes versions and should be validated separately.

Intended use

This adapter is intended for research, evaluation, and creative conversational experiments. It is not intended as a source of factual authority or for high-stakes decisions.

Limitations

  • —The personality can be emotionally expressive, opinionated, or inconsistent.
  • —Outputs may contain inaccuracies or reflect biases present in the base model and fine-tuning data.
  • —Performance can vary with prompt language, chat template, quantization setup, and generation parameters.
  • —The adapter must be combined with its compatible base model.
  • —Users are responsible for reviewing outputs and complying with the base model's license and acceptable-use requirements.

Framework versions

  • —Python 3.11.5
  • —PyTorch 2.11.0+cu128
  • —Transformers 5.9.0
  • —PEFT 0.19.1
  • —bitsandbytes 0.49.2
  • —Accelerate 1.13.0