Downloads · 30 days
46
10% of all-time downloads
ssmits/Zamba2-1.2B-instruct-Dutch
Zamba2-1.2B-instruct-Dutch is a text generation model from ssmits. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Zamba2-1.2B-instruct-Dutch is a basic Dutch language instruction-following model obtained through a two-stage fine-tuning process:
Downloads · 30 days
46
10% of all-time downloads
All-time downloads
473
Public
Parameters
1.2B
2.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.4 GB · 100%
From the Hugging Face model README
Zamba2-1.2B-instruct-Dutch is a basic Dutch language instruction-following model obtained through a two-stage fine-tuning process:
First stage (Base instruction model by Zyphra):
Second stage (Dutch language adaptation):
The model maintains the core hybrid architecture of Zamba2 while being optimized for Dutch language understanding and generation. By building upon Zyphra's instruction-tuned model, it inherits strong general instruction-following capabilities while adding Dutch language proficiency.
To download Zamba2-1.2B-instruct-Dutch, clone Zyphra's fork of transformers:
git clone https://github.com/Zyphra/transformers_zamba2.gitcd transformers_zamba2pip install -e .pip install acceleratefrom transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Instantiate model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Zyphra/Zamba2-1.2B-instruct-Dutch")
model = AutoModelForCausalLM.from_pretrained("Zyphra/Zamba2-1.2B-instruct-Dutch", device_map="cuda", torch_dtype=torch.bfloat16)
# Format the input as a chat template
prompt = "Wat zijn de belangrijkste oorzaken van de val van het Romeinse Rijk?"
sample = [{'role': 'user', 'content': prompt}]
chat_sample = tokenizer.apply_chat_template(sample, tokenize=False)
# Tokenize input and generate output
input_ids = tokenizer(chat_sample, return_tensors='pt', add_special_tokens=False).to("cuda")
outputs = model.generate(**input_ids, max_new_tokens=150, return_dict_in_generate=False, output_scores=False, use_cache=True, num_beams=1, do_sample=False)
print((tokenizer.decode(outputs[0])))
The model was fine-tuned using the following approach:
The model includes an advanced learning rate optimization system for fine-tuning, implemented through the LROptimizerCallback class:
from transformers import AutoTokenizer, Trainer
from lr_optimizer import setup_training, LROptimizerCallback
callback = LROptimizerCallback(
num_trials=10,
lr_range=(1e-6, 1e-4)
)
trainer = Trainer(
model=model,
args=training_args,
callbacks=[callback]
)
trainer.train()
Zamba2-1.2B-instruct-Dutch maintains the hybrid SSM-attention architecture of the base model:
The model maintains the efficient inference characteristics of the base Zamba2 architecture:
| Time to First Token (TTFT) | Output Generation |
|---|---|
![]() | ![]() |
Memory overhead:
<center> <img src="https://cdn-uploads.huggingface.co/production/uploads/65c05e75c084467acab2f84a/m0YUmAmiVnRg6l9m10CEt.png" width="400" alt="Zamba inference and memory cost"> </center>This model is released under the Apache 2.0 license.
Note: This is a temporary HuggingFace implementation. A standalone PyTorch implementation may be found at Zamba2 GitHub repository.