How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("token-classification", model="khwstolle/prose-format-bert-small")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("khwstolle/prose-format-bert-small")
model = AutoModelForTokenClassification.from_pretrained("khwstolle/prose-format-bert-small", device_map="auto")
Quick Links

khwstolle/prose-format-bert-small

This model predicts token-level line-break and indentation boundaries for formatting prose and documentation with prose-format.

Architecture Details

  • Base Architecture: BertForTokenClassification
  • Hidden Dimensions: 512
  • Hidden Layers: 4
  • Attention Heads: 8
  • Maximum Sequence Length: 512 tokens
  • Output Classes: 9 line-break boundary classes

Direct Inference with Transformers

This repository contains standard Hugging Face configuration and model weights, allowing standard loading via transformers:

import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer

model_id = "khwstolle/prose-format-bert-small"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)
model.eval()

text = "Clear line breaks improve version control diff readability."
inputs = tokenizer(text, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits
    predictions = logits.argmax(dim=-1)
Downloads last month
28
Safetensors
Model size
28.5M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support