Downloads · 30 days
0
wjbmattingly/Qwen3-VL-8B-german-shorthand
Qwen3-VL-8B-german-shorthand is a machine learning model from wjbmattingly. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model is a fine-tuned version of Qwen/Qwen3-VL-8B-Instruct for transcribing medieval German shorthand from images. It has been trained using TRL on the wjbmattingly/german-shorthand-window-5-4 dataset.
Downloads · 30 days
0
Access
Public
Updated Oct 23, 2025
Repo size
3.3 GB
Likes
1
Public
Click a slice to open those files.
.safetensors175 MB · 92%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen3-VL-8B-Instruct for transcribing medieval German shorthand from images. It has been trained using TRL on the wjbmattingly/german-shorthand-window-5-4 dataset.
This vision-language model specializes in transcribing text from images of German shorthand documents. Given an image of shorthand text, the model generates the corresponding transcription.
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration
from peft import PeftModel
from PIL import Image
# Load model and processor
base_model = "Qwen/Qwen3-VL-8B-Instruct"
adapter_model = "wjbmattingly/Qwen3-VL-8B-german-shorthand"
model = Qwen3VLForConditionalGeneration.from_pretrained(
base_model,
torch_dtype="auto",
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter_model)
processor = AutoProcessor.from_pretrained(base_model)
# Load your image
image = Image.open("path/to/your/shorthand_image.jpg")
# Prepare the message
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Transcribe the text shown in this image."},
],
},
]
# Generate transcription
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt"
).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=256)
generated_ids_trimmed = [
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
transcription = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
print(transcription)
This model was fine-tuned using Supervised Fine-Tuning (SFT) with LoRA adapters on the Qwen3-VL-8B-Instruct base model.
The model was trained on wjbmattingly/german-shorthand-window-5-4, a dataset containing images of German shorthand with corresponding text transcriptions.
Cite TRL as:
@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}}
}