Instructions to use khwstolle/prose-format-bert-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khwstolle/prose-format-bert-small with Transformers:
# 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") - Notebooks
- Google Colab
- Kaggle
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