Downloads · 30 days
0
mslacken/t5-finetune-changelog
t5-finetune-changelog is a text generation model from mslacken. 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.
Collection of fine-tuned T5 models (small, base, and large) for generating human-readable changelog entries from code changes and diffs.
Downloads · 30 days
0
Access
Public
Updated May 11, 2026
Repo size
11.8 GB
Likes
0
Public
Click a slice to open those files.
.bin7.7 GB · 65%
From the Hugging Face model README
Collection of fine-tuned T5 models (small, base, and large) for generating human-readable changelog entries from code changes and diffs.
These models generate concise, informative changelog entries for the Open Build Serve and
where trained with accepted requests to openSUSE:Factory with the diffs of the spec file and every files which looks like
a changelog.
The only use case is generating a changelog entry after a package change
CTranslate2 provides 2-4x faster inference with lower memory usage. Ideal for production deployments.
pip install ctranslate2 transformers
import ctranslate2
from transformers import AutoTokenizer
from huggingface_hub import snapshot_download
# Choose quantization variant:
# - float32: Full precision, no quality loss
# - float16: 50% smaller, GPU only
# - int8_float16: 75% smaller, GPU only
# - int8: 75% smaller, CPU/GPU compatible (Recommended)
repo_id = "mslacken/t5-finetune-changelog"
model_size = "large" # Recommended
quantization = "int8" # Recommended: int8 for CPU/GPU compatibility
# Download CTranslate2 model from HuggingFace
print("Downloading model...")
model_dir = snapshot_download(
repo_id=repo_id,
allow_patterns=f"ct2_models/t5-{model_size}-ct2-{quantization}/*"
)
ct2_model_path = f"{model_dir}/ct2_models/t5-{model_size}-ct2-{quantization}"
# Load CTranslate2 model
translator = ctranslate2.Translator(ct2_model_path, device="cpu") # or "cuda"
# Load tokenizer from the fine-tuned model
subfolder = f"t5-{model_size}"
tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder=subfolder)
# Helper function to decode while preserving newlines
def decode_changelog(tokens):
import re
decoded = tokenizer.decode(tokenizer.convert_tokens_to_ids(tokens), skip_special_tokens=False)
decoded = decoded.replace(tokenizer.pad_token or "<pad>", "")
decoded = decoded.replace(tokenizer.eos_token or "</s>", "")
decoded = re.sub(r"<extra_id_\d+>", "", decoded)
return decoded.strip()
# Example input
input_text = """create structured changelog for package warewulf4 from 4.2.0 to 4.3.0rc2:
changelog:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- Provision interface is not tied to 'eth0' any more. The provision interface must be named
'default' now. The file 'nodes.yaml' must be changed accordingly.
- Creating of '/etc/exports' can now be disabled, so that wwctl configure -a wont overwrite
a existing '/etc/exports'.
- All configurations files for the host (/etc/exports, /etc/dhcpd.conf, /etc/hosts) are now
populated from the templates."""
# Tokenize input
input_tokens = tokenizer.convert_ids_to_tokens(
tokenizer.encode(input_text, max_length=1024, truncation=True)
)
# Generate with CTranslate2
results = translator.translate_batch(
[input_tokens],
beam_size=6,
max_decoding_length=512,
no_repeat_ngram_size=4
)
# Decode output
changelog = decode_changelog(results[0].hypotheses[0])
print(changelog)
# Expected output:
# - update to v4.3.0rc2 with following major changes:
# * Provision interface is not tied to 'eth0' any more. The provision interface
# must be named 'default' now. The file `nodes.yaml' must be changed accordingly.
# * Creating of '/etc/exports' can now be disabled, so that wwctl configure -a
# wont overwrite a existing '/etc/exports'.
# * All configurations files for the host (/etc/exports, /etc/dhcpd.conf,
# /etc/hosts) are now populated from the templates.
| Variant | Size vs Original | Device | Speed |
|---|---|---|---|
| float32 | 100% | CPU/GPU | 2x |
| float16 | 50% | GPU only | 2-3x |
| int8_float16 | 25% | GPU only | 2-4x |
| int8 | 25% | CPU/GPU | 2x |
Recommendations:
int8_float16 (best speed/memory balance)int8 (small size, CPU compatible)float32 or float16Each model variant is in its own subdirectory. Use the subfolder parameter to select the variant:
from transformers import T5ForConditionalGeneration, AutoTokenizer
# Repository ID
repo_id = "mslacken/t5-finetune-changelog"
# Choose one of the three variants:
# - subfolder="t5-small" (fastest, 231 MB) - NOT recommended
# - subfolder="t5-base" (balanced, 850 MB)
# - subfolder="t5-large" (best quality, 2.8 GB) - Recommended
subfolder = "t5-large"
model = T5ForConditionalGeneration.from_pretrained(repo_id, subfolder=subfolder)
tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder=subfolder)
# Helper function to decode while preserving newlines
def decode_changelog(output_ids):
# Decode without removing special tokens first
decoded = tokenizer.decode(output_ids, skip_special_tokens=False)
# Remove only standard T5 tokens, keep our custom \n token
import re
decoded = decoded.replace(tokenizer.pad_token or "<pad>", "")
decoded = decoded.replace(tokenizer.eos_token or "</s>", "")
decoded = re.sub(r"<extra_id_\d+>", "", decoded) # Remove sentinel tokens
return decoded.strip()
# Generation parameters (recommended to prevent repetitions):
# - num_beams=4: Use beam search for better quality
# - repetition_penalty=1.2: Penalize repeated tokens
# - no_repeat_ngram_size=3: Prevent 3-word phrase repetition
# - early_stopping=True: Stop when EOS token is generated
# Example input
input_text = """create structured changelog for package warewulf4 from 4.2.0 to 4.3.0rc2:
changelog:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- Provision interface is not tied to 'eth0' any more. The provision interface must be named
'default' now. The file 'nodes.yaml' must be changed accordingly.
- Creating of '/etc/exports' can now be disabled, so that wwctl configure -a wont overwrite
a existing '/etc/exports'.
- All configurations files for the host (/etc/exports, /etc/dhcpd.conf, /etc/hosts) are now
populated from the templates."""
inputs = tokenizer(input_text, return_tensors="pt", max_length=1024, truncation=True)
outputs = model.generate(
**inputs,
max_length=512,
num_beams=6,
no_repeat_ngram_size=4,
early_stopping=True
)
changelog = decode_changelog(outputs[0])
print(changelog)
# Expected output:
# - update to v4.3.0rc2 with following major changes:
# * Provision interface is not tied to 'eth0' any more. The provision interface
# must be named 'default' now. The file `nodes.yaml' must be changed accordingly.
# * Creating of '/etc/exports' can now be disabled, so that wwctl configure -a
# wont overwrite a existing '/etc/exports'.
# * All configurations files for the host (/etc/exports, /etc/dhcpd.conf,
# /etc/hosts) are now populated from the templates.
from transformers import T5ForConditionalGeneration, AutoTokenizer
repo_id = "mslacken/t5-finetune-changelog"
subfolder = "t5-large" # Recommended
# Load model and tokenizer
model = T5ForConditionalGeneration.from_pretrained(repo_id, subfolder=subfolder)
tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder=subfolder)
# Helper function to decode while preserving newlines
def decode_changelog(output_ids):
import re
decoded = tokenizer.decode(output_ids, skip_special_tokens=False)
decoded = decoded.replace(tokenizer.pad_token or "<pad>", "")
decoded = decoded.replace(tokenizer.eos_token or "</s>", "")
decoded = re.sub(r"<extra_id_\d+>", "", decoded)
return decoded.strip()
# Example input
input_text = """create structured changelog for package warewulf4 from 4.2.0 to 4.3.0rc2:
changelog:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- Provision interface is not tied to 'eth0' any more. The provision interface must be named
'default' now. The file 'nodes.yaml' must be changed accordingly.
- Creating of '/etc/exports' can now be disabled, so that wwctl configure -a wont overwrite
a existing '/etc/exports'.
- All configurations files for the host (/etc/exports, /etc/dhcpd.conf, /etc/hosts) are now
populated from the templates."""
inputs = tokenizer(input_text, return_tensors="pt", max_length=1024, truncation=True)
outputs = model.generate(
**inputs,
max_length=512,
num_beams=6,
no_repeat_ngram_size=4,
early_stopping=True
)
changelog = decode_changelog(outputs[0])
print(changelog)
# Expected output:
# - update to v4.3.0rc2 with following major changes:
# * Provision interface is not tied to 'eth0' any more. The provision interface
# must be named 'default' now. The file `nodes.yaml' must be changed accordingly.
# * Creating of '/etc/exports' can now be disabled, so that wwctl configure -a
# wont overwrite a existing '/etc/exports'.
# * All configurations files for the host (/etc/exports, /etc/dhcpd.conf,
# /etc/hosts) are now populated from the templates.
Note: All three model variants were trained on the same dataset with the same hyperparameters, differing only in their base model size.
Base Models:
google-t5/t5-small (60M parameters)google-t5/t5-base (220M parameters)google-t5/t5-large (770M parameters)Hyperparameters:
Training Infrastructure:
Special tokens:
\n as additional special token for better diff handlingInput format:
generate changelog: [code diff or change description]
Target format:
[Human-readable changelog entry]
Tokenization:
The model was trained with early stopping based on validation loss. The best checkpoint was automatically selected and saved as the final model.
t5-finetune-changelog/
├── t5-small/ # 231 MB (NOT recommended - hallucinates)
│ ├── config.json
│ ├── generation_config.json
│ ├── model.safetensors
│ ├── tokenizer.json
│ └── tokenizer_config.json
├── t5-base/ # 850 MB - Balanced
│ └── [same files]
├── t5-large/ # 2.8 GB - Best quality (Recommended)
│ └── [same files]
└── ct2_models/ # CTranslate2 optimized models (2-4x faster inference)
├── t5-base-ct2-float32/ # Full precision (~850 MB)
├── t5-base-ct2-float16/ # GPU only (~425 MB)
├── t5-base-ct2-int8_float16/ # GPU only (~220 MB)
├── t5-base-ct2-int8/ # CPU/GPU compatible (~220 MB)
├── t5-large-ct2-float32/ # Full precision (~2.8 GB)
├── t5-large-ct2-float16/ # GPU only (~1.4 GB)
├── t5-large-ct2-int8_float16/ # GPU only (~770 MB)
└── t5-large-ct2-int8/ # CPU/GPU compatible (~770 MB)
Models are provided in two formats:
If you use this model in your research or projects, please cite:
@misc{t5-changelog-collection-2026,
author = {Christian Goll},
title = {T5 Changelog Generator Collection},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/mslacken/t5-finetune-changelog}}
}
This model is licensed under Apache 2.0, same as the base T5 model.
Contact: Christian Goll [email protected]
Issues: Please report issues or feedback on the model's discussion page.