//clika-runtime/io.clika.modelverse/DiarizationModel
DiarizationModel
[common]
class DiarizationModel : PreTrainedModel
A speaker-diarization model: a clip in, who spoke when out, as SpeakerSegments in time order (the voice-activity-detection kind).
Open it with open from a checkpoint the model library's diarization families claim (a family that declares who-spoke-when out of audio under the voice-activity-detection tag). Hand it a clip as 16-bit PCM with diarize; the segments arrive through the listener on the model's own worker thread, one clip at a time per model. close frees the weights.
Types
| Name | Summary |
|---|---|
| Companion | [common] object Companion |
Properties
| Name | Summary |
|---|---|
| capabilities | [common] val capabilities: Capabilities What the model takes and gives, read when it opened. |
| config | [common] open override val config: PretrainedConfig The checkpoint's identity, read when the model opened. |
Functions
| Name | Summary |
|---|---|
| close | [common] open fun close() Free the model. A running request is canceled first and the call waits for it to return; called from inside a listener callback, the free runs right after that callback's request ends instead. Idempotent. |
| diarize | [common] fun diarize(pcm16: ShortArray, sampleRate: Int, options: DiarizeOptions = DiarizeOptions(), listener: DiarizeListener): DiarizeHandle Diarize pcm16, mono 16-bit samples at sampleRate hertz (the clip is resampled to the model's 16 kHz), under options. Returns at once; the worker runs the request and calls listener on its thread: DiarizeListener.onSegments with the segments in time order, then DiarizeListener.onDone with the DiarizeReport. |
| residency | [common] open override fun residency(): ResidencyReport What the model holds on each device right now (ResidencyReport); a closed model refuses with ModelverseException. |