Skip to content
1 min read · 83 words

Type Alias: CreateTransformersJsCaptionPipeline ​

ts
type CreateTransformersJsCaptionPipeline = (input: {
  device?: TransformersJsCaptionDeviceType;
  dtype?: TransformersJsCaptionDataType;
  model: string;
  onInitProgress?: TransformersJsCaptionProgressCallback;
}) => Promise<TransformersJsCaptionPipeline>;

Defined in: src/batteries/specialists/caption/transformers_js/types.ts:75

Factory for lazily creating an image-to-text pipeline. Defaults to a dynamic import of @huggingface/transformers + pipeline('image-to-text', …); override to inject a pre-built pipeline or a test double.

Parameters ​

ParameterType
input{ device?: TransformersJsCaptionDeviceType; dtype?: TransformersJsCaptionDataType; model: string; onInitProgress?: TransformersJsCaptionProgressCallback; }
input.device?TransformersJsCaptionDeviceType
input.dtype?TransformersJsCaptionDataType
input.modelstring
input.onInitProgress?TransformersJsCaptionProgressCallback

Returns ​

Promise<TransformersJsCaptionPipeline>