//clika-runtime/io.clika.modelverse/Modelverse/pipeline
pipeline
[common]
fun pipeline(task: String, source: String, options: LoadOptions = LoadOptions(), stageObserver: StageObserver? = null): Pipeline
The pipeline of task (transformers' task strings: text-generation, automatic-speech-recognition, text-to-speech, translation, image-to-text, object-detection, depth-estimation, image-feature-extraction, zero-shot-image-classification, feature-extraction, text-ranking, voice-activity-detection, text-to-image, text-to-video, and their aliases) over the model source loads as: a snapshot directory, a hub repo id or a GGUF file, under options. stageObserver is installed on the model where its kind reports stages (GenerativeModel); a kind that reports none refuses it. An unknown task refuses with IllegalArgumentException naming the tasks; a task whose handle is not in this binding refuses with ModelverseException. The pipeline owns the model.
[common]
fun pipeline(task: String, model: PreTrainedModel): Pipeline
The pipeline of task over an already loaded model; a model of another class refuses with IllegalArgumentException.