Harmonic Base
is a fine-tuned version of
Google's Gemma 4 31B Instruct
, trained using supervised fine-tuning (SFT) with LoRA adapters and then merged into the full model weights.
This is the
full-precision (bf16)
merged model. Quantized versions are also available:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "DJLougen/gemma-4-31B-it-Harmonic-Base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "user", "content": "What is the meaning of life?"}
]
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(input_ids, max_new_tokens=512)
print(tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True))
Merge Process
The LoRA adapters were merged into the base model weights using the formula:
W_merged = W_base + B @ A * (alpha / r)
With
alpha = r = 32
, the scaling factor is
1.0
. All 599 LoRA layer pairs (across 60 transformer layers, 7 target modules each) were merged directly into the safetensor shards.
Citation
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
Runs of DJLougen gemma-4-31B-it-Harmonic on huggingface.co
1
Total runs
0
24-hour runs
0
3-day runs
-2
7-day runs
-3
30-day runs
More Information About gemma-4-31B-it-Harmonic huggingface.co Model
gemma-4-31B-it-Harmonic huggingface.co is an AI model on huggingface.co that provides gemma-4-31B-it-Harmonic's model effect (), which can be used instantly with this DJLougen gemma-4-31B-it-Harmonic model. huggingface.co supports a free trial of the gemma-4-31B-it-Harmonic model, and also provides paid use of the gemma-4-31B-it-Harmonic. Support call gemma-4-31B-it-Harmonic model through api, including Node.js, Python, http.
gemma-4-31B-it-Harmonic huggingface.co is an online trial and call api platform, which integrates gemma-4-31B-it-Harmonic's modeling effects, including api services, and provides a free online trial of gemma-4-31B-it-Harmonic, you can try gemma-4-31B-it-Harmonic online for free by clicking the link below.
DJLougen gemma-4-31B-it-Harmonic online free url in huggingface.co:
gemma-4-31B-it-Harmonic is an open source model from GitHub that offers a free installation service, and any user can find gemma-4-31B-it-Harmonic on GitHub to install. At the same time, huggingface.co provides the effect of gemma-4-31B-it-Harmonic install, users can directly use gemma-4-31B-it-Harmonic installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
gemma-4-31B-it-Harmonic install url in huggingface.co: