Skip to main content
The public contextual API has one implementation: PremoveITN.

Load the model

from_pretrained() downloads the pinned public model on first use and uses the Hugging Face cache on later loads. Create one instance and reuse it. Model initialization is expensive.

Parameters

  • model_id accepts the public model ID or a local inference-artifact directory.
  • revision accepts the pinned commit or the verified v0.1.0 release tag.
  • device accepts auto, cpu, mps, or cuda.
The loader verifies release metadata and the model-file digest before inference. An arbitrary Hub repository is not accepted. A local artifact must match the frozen release contract. device="auto" selects CUDA when available, then Apple MPS, then CPU. CUDA is an API option, but it is not a validated v0.1.0 platform claim.

Normalize a transcript

normalize() accepts one string and returns one string. It raises TypeError for a non-string input. Empty and whitespace-only strings are returned unchanged. If the text produces candidates, inputs longer than 512 DeBERTa encoder tokens are rejected instead of being truncated. Text with no candidates returns unchanged before tokenization.

Reuse one instance

For model lifecycle and supported environments, see Deployment. For a streaming shell workflow, see the CLI.