@huggingface/inference 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +162 -69
- package/dist/index.js +162 -69
- package/dist/src/providers/fal-ai.d.ts.map +1 -1
- package/dist/src/providers/replicate.d.ts.map +1 -1
- package/dist/src/tasks/audio/audioClassification.d.ts +4 -18
- package/dist/src/tasks/audio/audioClassification.d.ts.map +1 -1
- package/dist/src/tasks/audio/audioToAudio.d.ts +10 -9
- package/dist/src/tasks/audio/audioToAudio.d.ts.map +1 -1
- package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts +3 -12
- package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -1
- package/dist/src/tasks/audio/textToSpeech.d.ts +4 -8
- package/dist/src/tasks/audio/textToSpeech.d.ts.map +1 -1
- package/dist/src/tasks/audio/utils.d.ts +11 -0
- package/dist/src/tasks/audio/utils.d.ts.map +1 -0
- package/dist/src/tasks/cv/imageClassification.d.ts +3 -17
- package/dist/src/tasks/cv/imageClassification.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageSegmentation.d.ts +3 -21
- package/dist/src/tasks/cv/imageSegmentation.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageToImage.d.ts +3 -49
- package/dist/src/tasks/cv/imageToImage.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageToText.d.ts +3 -12
- package/dist/src/tasks/cv/imageToText.d.ts.map +1 -1
- package/dist/src/tasks/cv/objectDetection.d.ts +3 -26
- package/dist/src/tasks/cv/objectDetection.d.ts.map +1 -1
- package/dist/src/tasks/cv/textToImage.d.ts +3 -38
- package/dist/src/tasks/cv/textToImage.d.ts.map +1 -1
- package/dist/src/tasks/cv/textToVideo.d.ts +6 -0
- package/dist/src/tasks/cv/textToVideo.d.ts.map +1 -0
- package/dist/src/tasks/cv/utils.d.ts +11 -0
- package/dist/src/tasks/cv/utils.d.ts.map +1 -0
- package/dist/src/tasks/cv/zeroShotImageClassification.d.ts +7 -15
- package/dist/src/tasks/cv/zeroShotImageClassification.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts +5 -28
- package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts +5 -20
- package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/fillMask.d.ts +2 -21
- package/dist/src/tasks/nlp/fillMask.d.ts.map +1 -1
- package/dist/src/tasks/nlp/questionAnswering.d.ts +3 -25
- package/dist/src/tasks/nlp/questionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/sentenceSimilarity.d.ts +2 -13
- package/dist/src/tasks/nlp/sentenceSimilarity.d.ts.map +1 -1
- package/dist/src/tasks/nlp/summarization.d.ts +2 -42
- package/dist/src/tasks/nlp/summarization.d.ts.map +1 -1
- package/dist/src/tasks/nlp/tableQuestionAnswering.d.ts +3 -31
- package/dist/src/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/textClassification.d.ts +2 -16
- package/dist/src/tasks/nlp/textClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/tokenClassification.d.ts +2 -45
- package/dist/src/tasks/nlp/tokenClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/translation.d.ts +2 -13
- package/dist/src/tasks/nlp/translation.d.ts.map +1 -1
- package/dist/src/tasks/nlp/zeroShotClassification.d.ts +2 -22
- package/dist/src/tasks/nlp/zeroShotClassification.d.ts.map +1 -1
- package/dist/src/types.d.ts +4 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/providers/fal-ai.ts +4 -0
- package/src/providers/replicate.ts +3 -0
- package/src/tasks/audio/audioClassification.ts +7 -22
- package/src/tasks/audio/audioToAudio.ts +43 -23
- package/src/tasks/audio/automaticSpeechRecognition.ts +35 -23
- package/src/tasks/audio/textToSpeech.ts +8 -14
- package/src/tasks/audio/utils.ts +18 -0
- package/src/tasks/cv/imageClassification.ts +5 -20
- package/src/tasks/cv/imageSegmentation.ts +5 -24
- package/src/tasks/cv/imageToImage.ts +4 -52
- package/src/tasks/cv/imageToText.ts +6 -15
- package/src/tasks/cv/objectDetection.ts +5 -30
- package/src/tasks/cv/textToImage.ts +14 -50
- package/src/tasks/cv/textToVideo.ts +67 -0
- package/src/tasks/cv/utils.ts +13 -0
- package/src/tasks/cv/zeroShotImageClassification.ts +32 -31
- package/src/tasks/multimodal/documentQuestionAnswering.ts +25 -43
- package/src/tasks/multimodal/visualQuestionAnswering.ts +20 -36
- package/src/tasks/nlp/fillMask.ts +2 -22
- package/src/tasks/nlp/questionAnswering.ts +22 -36
- package/src/tasks/nlp/sentenceSimilarity.ts +12 -15
- package/src/tasks/nlp/summarization.ts +2 -43
- package/src/tasks/nlp/tableQuestionAnswering.ts +25 -41
- package/src/tasks/nlp/textClassification.ts +3 -18
- package/src/tasks/nlp/tokenClassification.ts +2 -47
- package/src/tasks/nlp/translation.ts +3 -17
- package/src/tasks/nlp/zeroShotClassification.ts +2 -24
- package/src/types.ts +7 -1
|
@@ -1,55 +1,9 @@
|
|
|
1
|
+
import type { ImageToImageInput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type ImageToImageArgs = BaseArgs &
|
|
3
|
-
/**
|
|
4
|
-
* The initial image condition
|
|
5
|
-
*
|
|
6
|
-
**/
|
|
7
|
-
inputs: Blob | ArrayBuffer;
|
|
8
|
-
parameters?: {
|
|
9
|
-
/**
|
|
10
|
-
* The text prompt to guide the image generation.
|
|
11
|
-
*/
|
|
12
|
-
prompt?: string;
|
|
13
|
-
/**
|
|
14
|
-
* strengh param only works for SD img2img and alt diffusion img2img models
|
|
15
|
-
* Conceptually, indicates how much to transform the reference `image`. Must be between 0 and 1. `image`
|
|
16
|
-
* will be used as a starting point, adding more noise to it the larger the `strength`. The number of
|
|
17
|
-
* denoising steps depends on the amount of noise initially added. When `strength` is 1, added noise will
|
|
18
|
-
* be maximum and the denoising process will run for the full number of iterations specified in
|
|
19
|
-
* `num_inference_steps`. A value of 1, therefore, essentially ignores `image`.
|
|
20
|
-
**/
|
|
21
|
-
strength?: number;
|
|
22
|
-
/**
|
|
23
|
-
* An optional negative prompt for the image generation
|
|
24
|
-
*/
|
|
25
|
-
negative_prompt?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The height in pixels of the generated image
|
|
28
|
-
*/
|
|
29
|
-
height?: number;
|
|
30
|
-
/**
|
|
31
|
-
* The width in pixels of the generated image
|
|
32
|
-
*/
|
|
33
|
-
width?: number;
|
|
34
|
-
/**
|
|
35
|
-
* The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
|
|
36
|
-
*/
|
|
37
|
-
num_inference_steps?: number;
|
|
38
|
-
/**
|
|
39
|
-
* Guidance scale: Higher guidance scale encourages to generate images that are closely linked to the text `prompt`, usually at the expense of lower image quality.
|
|
40
|
-
*/
|
|
41
|
-
guidance_scale?: number;
|
|
42
|
-
/**
|
|
43
|
-
* guess_mode only works for ControlNet models, defaults to False In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
|
|
44
|
-
* you remove all prompts. The `guidance_scale` between 3.0 and 5.0 is recommended.
|
|
45
|
-
*/
|
|
46
|
-
guess_mode?: boolean;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
export type ImageToImageOutput = Blob;
|
|
3
|
+
export type ImageToImageArgs = BaseArgs & ImageToImageInput;
|
|
50
4
|
/**
|
|
51
5
|
* This task reads some text input and outputs an image.
|
|
52
6
|
* Recommended model: lllyasviel/sd-controlnet-depth
|
|
53
7
|
*/
|
|
54
|
-
export declare function imageToImage(args: ImageToImageArgs, options?: Options): Promise<
|
|
8
|
+
export declare function imageToImage(args: ImageToImageArgs, options?: Options): Promise<Blob>;
|
|
55
9
|
//# sourceMappingURL=imageToImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageToImage.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/imageToImage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"imageToImage.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/imageToImage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAIlE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAE5D;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB3F"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { ImageToTextInput, ImageToTextOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Binary image data
|
|
5
|
-
*/
|
|
6
|
-
data: Blob | ArrayBuffer;
|
|
7
|
-
};
|
|
8
|
-
export interface ImageToTextOutput {
|
|
9
|
-
/**
|
|
10
|
-
* The generated caption
|
|
11
|
-
*/
|
|
12
|
-
generated_text: string;
|
|
13
|
-
}
|
|
3
|
+
import type { LegacyImageInput } from "./utils";
|
|
4
|
+
export type ImageToTextArgs = BaseArgs & (ImageToTextInput | LegacyImageInput);
|
|
14
5
|
/**
|
|
15
6
|
* This task reads some image input and outputs the text caption.
|
|
16
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageToText.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/imageToText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"imageToText.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/imageToText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;AAC/E;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CActG"}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
data: Blob | ArrayBuffer;
|
|
7
|
-
};
|
|
8
|
-
export interface ObjectDetectionOutputValue {
|
|
9
|
-
/**
|
|
10
|
-
* A dict (with keys [xmin,ymin,xmax,ymax]) representing the bounding box of a detected object.
|
|
11
|
-
*/
|
|
12
|
-
box: {
|
|
13
|
-
xmax: number;
|
|
14
|
-
xmin: number;
|
|
15
|
-
ymax: number;
|
|
16
|
-
ymin: number;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* The label for the class (model specific) of a detected object.
|
|
20
|
-
*/
|
|
21
|
-
label: string;
|
|
22
|
-
/**
|
|
23
|
-
* A float that represents how likely it is that the detected object belongs to the given class.
|
|
24
|
-
*/
|
|
25
|
-
score: number;
|
|
26
|
-
}
|
|
27
|
-
export type ObjectDetectionOutput = ObjectDetectionOutputValue[];
|
|
2
|
+
import type { ObjectDetectionInput, ObjectDetectionOutput } from "@huggingface/tasks";
|
|
3
|
+
import { type LegacyImageInput } from "./utils";
|
|
4
|
+
export type ObjectDetectionArgs = BaseArgs & (ObjectDetectionInput | LegacyImageInput);
|
|
28
5
|
/**
|
|
29
6
|
* This task reads some image input and outputs the likelihood of classes & bounding boxes of detected objects.
|
|
30
7
|
* Recommended model: facebook/detr-resnet-50
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectDetection.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/objectDetection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"objectDetection.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/objectDetection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,CAAC,oBAAoB,GAAG,gBAAgB,CAAC,CAAC;AAEvF;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuBlH"}
|
|
@@ -1,44 +1,9 @@
|
|
|
1
|
+
import type { TextToImageInput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type TextToImageArgs = BaseArgs &
|
|
3
|
-
/**
|
|
4
|
-
* The text to generate an image from
|
|
5
|
-
*/
|
|
6
|
-
inputs: string;
|
|
7
|
-
/**
|
|
8
|
-
* Same param but for external providers like Together, Replicate
|
|
9
|
-
*/
|
|
10
|
-
prompt?: string;
|
|
11
|
-
response_format?: "base64";
|
|
12
|
-
input?: {
|
|
13
|
-
prompt: string;
|
|
14
|
-
};
|
|
15
|
-
parameters?: {
|
|
16
|
-
/**
|
|
17
|
-
* An optional negative prompt for the image generation
|
|
18
|
-
*/
|
|
19
|
-
negative_prompt?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The height in pixels of the generated image
|
|
22
|
-
*/
|
|
23
|
-
height?: number;
|
|
24
|
-
/**
|
|
25
|
-
* The width in pixels of the generated image
|
|
26
|
-
*/
|
|
27
|
-
width?: number;
|
|
28
|
-
/**
|
|
29
|
-
* The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
|
|
30
|
-
*/
|
|
31
|
-
num_inference_steps?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Guidance scale: Higher guidance scale encourages to generate images that are closely linked to the text `prompt`, usually at the expense of lower image quality.
|
|
34
|
-
*/
|
|
35
|
-
guidance_scale?: number;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export type TextToImageOutput = Blob;
|
|
3
|
+
export type TextToImageArgs = BaseArgs & TextToImageInput;
|
|
39
4
|
/**
|
|
40
5
|
* This task reads some text input and outputs an image.
|
|
41
6
|
* Recommended model: stabilityai/stable-diffusion-2
|
|
42
7
|
*/
|
|
43
|
-
export declare function textToImage(args: TextToImageArgs, options?: Options): Promise<
|
|
8
|
+
export declare function textToImage(args: TextToImageArgs, options?: Options): Promise<Blob>;
|
|
44
9
|
//# sourceMappingURL=textToImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textToImage.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/textToImage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textToImage.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/textToImage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,oBAAoB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIrD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,gBAAgB,CAAC;AAW1D;;;GAGG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCzF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BaseArgs, Options } from "../../types";
|
|
2
|
+
import type { TextToVideoInput } from "@huggingface/tasks";
|
|
3
|
+
export type TextToVideoArgs = BaseArgs & TextToVideoInput;
|
|
4
|
+
export type TextToVideoOutput = Blob;
|
|
5
|
+
export declare function textToVideo(args: TextToVideoArgs, options?: Options): Promise<TextToVideoOutput>;
|
|
6
|
+
//# sourceMappingURL=textToVideo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textToVideo.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/textToVideo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAO3D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,gBAAgB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAcrC,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA0CtG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BaseArgs, RequestArgs } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
*/
|
|
5
|
+
export interface LegacyImageInput {
|
|
6
|
+
data: Blob | ArrayBuffer;
|
|
7
|
+
}
|
|
8
|
+
export declare function preparePayload(args: BaseArgs & ({
|
|
9
|
+
inputs: Blob;
|
|
10
|
+
} | LegacyImageInput)): RequestArgs;
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAC;CACzB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG,gBAAgB,CAAC,GAAG,WAAW,CAElG"}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
|
|
2
|
+
import type { ZeroShotImageClassificationInput, ZeroShotImageClassificationOutput } from "@huggingface/tasks";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
interface LegacyZeroShotImageClassificationInput {
|
|
3
7
|
inputs: {
|
|
4
|
-
/**
|
|
5
|
-
* Binary image data
|
|
6
|
-
*/
|
|
7
8
|
image: Blob | ArrayBuffer;
|
|
8
9
|
};
|
|
9
|
-
parameters: {
|
|
10
|
-
/**
|
|
11
|
-
* A list of strings that are potential classes for inputs. (max 10)
|
|
12
|
-
*/
|
|
13
|
-
candidate_labels: string[];
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export interface ZeroShotImageClassificationOutputValue {
|
|
17
|
-
label: string;
|
|
18
|
-
score: number;
|
|
19
10
|
}
|
|
20
|
-
export type
|
|
11
|
+
export type ZeroShotImageClassificationArgs = BaseArgs & (ZeroShotImageClassificationInput | LegacyZeroShotImageClassificationInput);
|
|
21
12
|
/**
|
|
22
13
|
* Classify an image to specified classes.
|
|
23
14
|
* Recommended model: openai/clip-vit-large-patch14-336
|
|
24
15
|
*/
|
|
25
16
|
export declare function zeroShotImageClassification(args: ZeroShotImageClassificationArgs, options?: Options): Promise<ZeroShotImageClassificationOutput>;
|
|
17
|
+
export {};
|
|
26
18
|
//# sourceMappingURL=zeroShotImageClassification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zeroShotImageClassification.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/zeroShotImageClassification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"zeroShotImageClassification.d.ts","sourceRoot":"","sources":["../../../../src/tasks/cv/zeroShotImageClassification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AAE9G;;GAEG;AACH,UAAU,sCAAsC;IAC/C,MAAM,EAAE;QAAE,KAAK,EAAE,IAAI,GAAG,WAAW,CAAA;KAAE,CAAC;CACtC;AAED,MAAM,MAAM,+BAA+B,GAAG,QAAQ,GACrD,CAAC,gCAAgC,GAAG,sCAAsC,CAAC,CAAC;AAwB7E;;;GAGG;AACH,wBAAsB,2BAA2B,CAChD,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iCAAiC,CAAC,CAY5C"}
|
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* You can use native `File` in browsers, or `new Blob([buffer])` in node, or for a base64 image `new Blob([btoa(base64String)])`, or even `await (await fetch('...)).blob()`
|
|
8
|
-
**/
|
|
9
|
-
image: Blob | ArrayBuffer;
|
|
10
|
-
question: string;
|
|
2
|
+
import type { DocumentQuestionAnsweringInput, DocumentQuestionAnsweringInputData, DocumentQuestionAnsweringOutput } from "@huggingface/tasks";
|
|
3
|
+
export type DocumentQuestionAnsweringArgs = BaseArgs & DocumentQuestionAnsweringInput & {
|
|
4
|
+
inputs: DocumentQuestionAnsweringInputData & {
|
|
5
|
+
image: Blob;
|
|
11
6
|
};
|
|
12
7
|
};
|
|
13
|
-
export interface DocumentQuestionAnsweringOutput {
|
|
14
|
-
/**
|
|
15
|
-
* A string that’s the answer within the document.
|
|
16
|
-
*/
|
|
17
|
-
answer: string;
|
|
18
|
-
/**
|
|
19
|
-
* ?
|
|
20
|
-
*/
|
|
21
|
-
end?: number;
|
|
22
|
-
/**
|
|
23
|
-
* A float that represents how likely that the answer is correct
|
|
24
|
-
*/
|
|
25
|
-
score?: number;
|
|
26
|
-
/**
|
|
27
|
-
* ?
|
|
28
|
-
*/
|
|
29
|
-
start?: number;
|
|
30
|
-
}
|
|
31
8
|
/**
|
|
32
9
|
* Answers a question on a document image. Recommended model: impira/layoutlm-document-qa.
|
|
33
10
|
*/
|
|
34
|
-
export declare function documentQuestionAnswering(args: DocumentQuestionAnsweringArgs, options?: Options): Promise<DocumentQuestionAnsweringOutput>;
|
|
11
|
+
export declare function documentQuestionAnswering(args: DocumentQuestionAnsweringArgs, options?: Options): Promise<DocumentQuestionAnsweringOutput[number]>;
|
|
35
12
|
//# sourceMappingURL=documentQuestionAnswering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/multimodal/documentQuestionAnswering.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"documentQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/multimodal/documentQuestionAnswering.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKrD,OAAO,KAAK,EACX,8BAA8B,EAC9B,kCAAkC,EAClC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GACnD,8BAA8B,GAAG;IAAE,MAAM,EAAE,kCAAkC,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAEnG;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC,CAgClD"}
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
+
import type { VisualQuestionAnsweringInput, VisualQuestionAnsweringInputData, VisualQuestionAnsweringOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type VisualQuestionAnsweringArgs = BaseArgs & {
|
|
3
|
-
inputs: {
|
|
4
|
-
|
|
5
|
-
* Raw image
|
|
6
|
-
*
|
|
7
|
-
* You can use native `File` in browsers, or `new Blob([buffer])` in node, or for a base64 image `new Blob([btoa(base64String)])`, or even `await (await fetch('...)).blob()`
|
|
8
|
-
**/
|
|
9
|
-
image: Blob | ArrayBuffer;
|
|
10
|
-
question: string;
|
|
3
|
+
export type VisualQuestionAnsweringArgs = BaseArgs & VisualQuestionAnsweringInput & {
|
|
4
|
+
inputs: VisualQuestionAnsweringInputData & {
|
|
5
|
+
image: Blob;
|
|
11
6
|
};
|
|
12
7
|
};
|
|
13
|
-
export interface VisualQuestionAnsweringOutput {
|
|
14
|
-
/**
|
|
15
|
-
* A string that’s the answer to a visual question.
|
|
16
|
-
*/
|
|
17
|
-
answer: string;
|
|
18
|
-
/**
|
|
19
|
-
* Answer correctness score.
|
|
20
|
-
*/
|
|
21
|
-
score: number;
|
|
22
|
-
}
|
|
23
8
|
/**
|
|
24
9
|
* Answers a question on an image. Recommended model: dandelin/vilt-b32-finetuned-vqa.
|
|
25
10
|
*/
|
|
26
|
-
export declare function visualQuestionAnswering(args: VisualQuestionAnsweringArgs, options?: Options): Promise<VisualQuestionAnsweringOutput>;
|
|
11
|
+
export declare function visualQuestionAnswering(args: VisualQuestionAnsweringArgs, options?: Options): Promise<VisualQuestionAnsweringOutput[number]>;
|
|
27
12
|
//# sourceMappingURL=visualQuestionAnswering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/multimodal/visualQuestionAnswering.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visualQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/multimodal/visualQuestionAnswering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAKlE,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GACjD,4BAA4B,GAAG;IAAE,MAAM,EAAE,gCAAgC,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAE/F;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC,CAsBhD"}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
+
import type { FillMaskInput, FillMaskOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type FillMaskArgs = BaseArgs &
|
|
3
|
-
inputs: string;
|
|
4
|
-
};
|
|
5
|
-
export type FillMaskOutput = {
|
|
6
|
-
/**
|
|
7
|
-
* The probability for this token.
|
|
8
|
-
*/
|
|
9
|
-
score: number;
|
|
10
|
-
/**
|
|
11
|
-
* The actual sequence of tokens that ran against the model (may contain special tokens)
|
|
12
|
-
*/
|
|
13
|
-
sequence: string;
|
|
14
|
-
/**
|
|
15
|
-
* The id of the token
|
|
16
|
-
*/
|
|
17
|
-
token: number;
|
|
18
|
-
/**
|
|
19
|
-
* The string representation of the token
|
|
20
|
-
*/
|
|
21
|
-
token_str: string;
|
|
22
|
-
}[];
|
|
3
|
+
export type FillMaskArgs = BaseArgs & FillMaskInput;
|
|
23
4
|
/**
|
|
24
5
|
* Tries to fill in a hole with a missing word (token to be precise). That’s the base task for BERT models.
|
|
25
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fillMask.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/fillMask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fillMask.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/fillMask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAoB7F"}
|
|
@@ -1,30 +1,8 @@
|
|
|
1
|
+
import type { QuestionAnsweringInput, QuestionAnsweringOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type QuestionAnsweringArgs = BaseArgs &
|
|
3
|
-
inputs: {
|
|
4
|
-
context: string;
|
|
5
|
-
question: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export interface QuestionAnsweringOutput {
|
|
9
|
-
/**
|
|
10
|
-
* A string that’s the answer within the text.
|
|
11
|
-
*/
|
|
12
|
-
answer: string;
|
|
13
|
-
/**
|
|
14
|
-
* The index (string wise) of the stop of the answer within context.
|
|
15
|
-
*/
|
|
16
|
-
end: number;
|
|
17
|
-
/**
|
|
18
|
-
* A float that represents how likely that the answer is correct
|
|
19
|
-
*/
|
|
20
|
-
score: number;
|
|
21
|
-
/**
|
|
22
|
-
* The index (string wise) of the start of the answer within context.
|
|
23
|
-
*/
|
|
24
|
-
start: number;
|
|
25
|
-
}
|
|
3
|
+
export type QuestionAnsweringArgs = BaseArgs & QuestionAnsweringInput;
|
|
26
4
|
/**
|
|
27
5
|
* Want to have a nice know-it-all bot that can answer any question?. Recommended model: deepset/roberta-base-squad2
|
|
28
6
|
*/
|
|
29
|
-
export declare function questionAnswering(args: QuestionAnsweringArgs, options?: Options): Promise<QuestionAnsweringOutput>;
|
|
7
|
+
export declare function questionAnswering(args: QuestionAnsweringArgs, options?: Options): Promise<QuestionAnsweringOutput[number]>;
|
|
30
8
|
//# sourceMappingURL=questionAnswering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/questionAnswering.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"questionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/questionAnswering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,sBAAsB,CAAC;AAEtE;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAyB1C"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
+
import type { SentenceSimilarityInput, SentenceSimilarityOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type SentenceSimilarityArgs = BaseArgs &
|
|
3
|
-
/**
|
|
4
|
-
* The inputs vary based on the model.
|
|
5
|
-
*
|
|
6
|
-
* For example when using sentence-transformers/paraphrase-xlm-r-multilingual-v1 the inputs will have a `source_sentence` string and
|
|
7
|
-
* a `sentences` array of strings
|
|
8
|
-
*/
|
|
9
|
-
inputs: Record<string, unknown> | Record<string, unknown>[];
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Returned values are a list of floats
|
|
13
|
-
*/
|
|
14
|
-
export type SentenceSimilarityOutput = number[];
|
|
3
|
+
export type SentenceSimilarityArgs = BaseArgs & SentenceSimilarityInput;
|
|
15
4
|
/**
|
|
16
5
|
* Calculate the semantic similarity between one text and a list of other sentences by comparing their embeddings.
|
|
17
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentenceSimilarity.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/sentenceSimilarity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentenceSimilarity.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/sentenceSimilarity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAG5F,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIrD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,uBAAuB,CAAC;AAExE;;GAEG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,wBAAwB,CAAC,CAanC"}
|
|
@@ -1,46 +1,6 @@
|
|
|
1
|
+
import type { SummarizationInput, SummarizationOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type SummarizationArgs = BaseArgs &
|
|
3
|
-
/**
|
|
4
|
-
* A string to be summarized
|
|
5
|
-
*/
|
|
6
|
-
inputs: string;
|
|
7
|
-
parameters?: {
|
|
8
|
-
/**
|
|
9
|
-
* (Default: None). Integer to define the maximum length in tokens of the output summary.
|
|
10
|
-
*/
|
|
11
|
-
max_length?: number;
|
|
12
|
-
/**
|
|
13
|
-
* (Default: None). Float (0-120.0). The amount of time in seconds that the query should take maximum. Network can cause some overhead so it will be a soft limit.
|
|
14
|
-
*/
|
|
15
|
-
max_time?: number;
|
|
16
|
-
/**
|
|
17
|
-
* (Default: None). Integer to define the minimum length in tokens of the output summary.
|
|
18
|
-
*/
|
|
19
|
-
min_length?: number;
|
|
20
|
-
/**
|
|
21
|
-
* (Default: None). Float (0.0-100.0). The more a token is used within generation the more it is penalized to not be picked in successive generation passes.
|
|
22
|
-
*/
|
|
23
|
-
repetition_penalty?: number;
|
|
24
|
-
/**
|
|
25
|
-
* (Default: 1.0). Float (0.0-100.0). The temperature of the sampling operation. 1 means regular sampling, 0 means always take the highest score, 100.0 is getting closer to uniform probability.
|
|
26
|
-
*/
|
|
27
|
-
temperature?: number;
|
|
28
|
-
/**
|
|
29
|
-
* (Default: None). Integer to define the top tokens considered within the sample operation to create new text.
|
|
30
|
-
*/
|
|
31
|
-
top_k?: number;
|
|
32
|
-
/**
|
|
33
|
-
* (Default: None). Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top_p.
|
|
34
|
-
*/
|
|
35
|
-
top_p?: number;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export interface SummarizationOutput {
|
|
39
|
-
/**
|
|
40
|
-
* The string after translation
|
|
41
|
-
*/
|
|
42
|
-
summary_text: string;
|
|
43
|
-
}
|
|
3
|
+
export type SummarizationArgs = BaseArgs & SummarizationInput;
|
|
44
4
|
/**
|
|
45
5
|
* This task is well known to summarize longer text into shorter text. Be careful, some models have a maximum length of input. That means that the summary cannot handle full books for instance. Be careful when choosing your model.
|
|
46
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarization.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/summarization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"summarization.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/summarization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAE9D;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU5G"}
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
+
import type { TableQuestionAnsweringInput, TableQuestionAnsweringOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type TableQuestionAnsweringArgs = BaseArgs &
|
|
3
|
-
inputs: {
|
|
4
|
-
/**
|
|
5
|
-
* The query in plain text that you want to ask the table
|
|
6
|
-
*/
|
|
7
|
-
query: string;
|
|
8
|
-
/**
|
|
9
|
-
* A table of data represented as a dict of list where entries are headers and the lists are all the values, all lists must have the same size.
|
|
10
|
-
*/
|
|
11
|
-
table: Record<string, string[]>;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export interface TableQuestionAnsweringOutput {
|
|
15
|
-
/**
|
|
16
|
-
* The aggregator used to get the answer
|
|
17
|
-
*/
|
|
18
|
-
aggregator: string;
|
|
19
|
-
/**
|
|
20
|
-
* The plaintext answer
|
|
21
|
-
*/
|
|
22
|
-
answer: string;
|
|
23
|
-
/**
|
|
24
|
-
* A list of coordinates of the cells contents
|
|
25
|
-
*/
|
|
26
|
-
cells: string[];
|
|
27
|
-
/**
|
|
28
|
-
* a list of coordinates of the cells referenced in the answer
|
|
29
|
-
*/
|
|
30
|
-
coordinates: number[][];
|
|
31
|
-
}
|
|
3
|
+
export type TableQuestionAnsweringArgs = BaseArgs & TableQuestionAnsweringInput;
|
|
32
4
|
/**
|
|
33
5
|
* Don’t know SQL? Don’t want to dive into a large spreadsheet? Ask questions in plain english! Recommended model: google/tapas-base-finetuned-wtq.
|
|
34
6
|
*/
|
|
35
|
-
export declare function tableQuestionAnswering(args: TableQuestionAnsweringArgs, options?: Options): Promise<TableQuestionAnsweringOutput>;
|
|
7
|
+
export declare function tableQuestionAnswering(args: TableQuestionAnsweringArgs, options?: Options): Promise<TableQuestionAnsweringOutput[number]>;
|
|
36
8
|
//# sourceMappingURL=tableQuestionAnswering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/tableQuestionAnswering.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tableQuestionAnswering.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/tableQuestionAnswering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,2BAA2B,CAAC;AAEhF;;GAEG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAY/C"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
+
import type { TextClassificationInput, TextClassificationOutput } from "@huggingface/tasks";
|
|
1
2
|
import type { BaseArgs, Options } from "../../types";
|
|
2
|
-
export type TextClassificationArgs = BaseArgs &
|
|
3
|
-
/**
|
|
4
|
-
* A string to be classified
|
|
5
|
-
*/
|
|
6
|
-
inputs: string;
|
|
7
|
-
};
|
|
8
|
-
export type TextClassificationOutput = {
|
|
9
|
-
/**
|
|
10
|
-
* The label for the class (model specific)
|
|
11
|
-
*/
|
|
12
|
-
label: string;
|
|
13
|
-
/**
|
|
14
|
-
* A floats that represents how likely is that the text belongs to this class.
|
|
15
|
-
*/
|
|
16
|
-
score: number;
|
|
17
|
-
}[];
|
|
3
|
+
export type TextClassificationArgs = BaseArgs & TextClassificationInput;
|
|
18
4
|
/**
|
|
19
5
|
* Usually used for sentiment-analysis this will output the likelihood of classes of an input. Recommended model: distilbert-base-uncased-finetuned-sst-2-english
|
|
20
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textClassification.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/textClassification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textClassification.d.ts","sourceRoot":"","sources":["../../../../src/tasks/nlp/textClassification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,uBAAuB,CAAC;AAExE;;GAEG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,wBAAwB,CAAC,CAanC"}
|