Run this model with HF Jobs
Run khwstolle/prose-format-bert-mini on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/khwstolle/prose-format-bert-mini. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/khwstolle/prose-format-bert-mini on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use khwstolle/prose-format-bert-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khwstolle/prose-format-bert-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="khwstolle/prose-format-bert-mini")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("khwstolle/prose-format-bert-mini") model = AutoModelForTokenClassification.from_pretrained("khwstolle/prose-format-bert-mini", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from khwstolle/prose-format-bert-mini: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/khwstolle/prose-format-bert-mini/resolve/main/README.md
- Command line
-
hf download hf://khwstolle/prose-format-bert-mini/README.md
-
curl -L -o README.md https://huggingface.co/khwstolle/prose-format-bert-mini/resolve/main/README.md
1.24 kB
| language: | |
| - en | |
| license: mit | |
| tags: | |
| - token-classification | |
| - prose-format | |
| - prose-formatting | |
| - pytorch | |
| - transformers | |
| pipeline_tag: token-classification | |
| # khwstolle/prose-format-bert-mini | |
| 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**: 256 | |
| - **Hidden Layers**: 4 | |
| - **Attention Heads**: 4 | |
| - **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`: | |
| ```python | |
| import torch | |
| from transformers import AutoModelForTokenClassification, AutoTokenizer | |
| model_id = "khwstolle/prose-format-bert-mini" | |
| 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) | |
| ``` | |