@huggingface/tasks 0.13.3 → 0.13.5
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/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/local-apps.d.ts.map +1 -1
- package/dist/commonjs/local-apps.js +40 -21
- package/dist/commonjs/local-apps.spec.d.ts +2 -0
- package/dist/commonjs/local-apps.spec.d.ts.map +1 -0
- package/dist/commonjs/local-apps.spec.js +114 -0
- package/dist/commonjs/model-libraries-snippets.d.ts.map +1 -1
- package/dist/commonjs/model-libraries-snippets.js +23 -12
- package/dist/commonjs/model-libraries-snippets.spec.d.ts +2 -0
- package/dist/commonjs/model-libraries-snippets.spec.d.ts.map +1 -0
- package/dist/commonjs/model-libraries-snippets.spec.js +51 -0
- package/dist/commonjs/model-libraries.d.ts +8 -1
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +7 -0
- package/dist/commonjs/tasks/audio-classification/inference.d.ts +3 -0
- package/dist/commonjs/tasks/audio-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts +0 -4
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/image-classification/inference.d.ts +3 -0
- package/dist/commonjs/tasks/image-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/index.d.ts +1 -1
- package/dist/commonjs/tasks/index.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-classification/inference.d.ts +3 -0
- package/dist/commonjs/tasks/text-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-speech/data.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-speech/data.js +15 -7
- package/dist/commonjs/tasks/video-classification/inference.d.ts +3 -0
- package/dist/commonjs/tasks/video-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts +9 -19
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts +9 -19
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts +8 -12
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/local-apps.d.ts.map +1 -1
- package/dist/esm/local-apps.js +40 -21
- package/dist/esm/local-apps.spec.d.ts +2 -0
- package/dist/esm/local-apps.spec.d.ts.map +1 -0
- package/dist/esm/local-apps.spec.js +112 -0
- package/dist/esm/model-libraries-snippets.d.ts.map +1 -1
- package/dist/esm/model-libraries-snippets.js +23 -12
- package/dist/esm/model-libraries-snippets.spec.d.ts +2 -0
- package/dist/esm/model-libraries-snippets.spec.d.ts.map +1 -0
- package/dist/esm/model-libraries-snippets.spec.js +49 -0
- package/dist/esm/model-libraries.d.ts +8 -1
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +7 -0
- package/dist/esm/tasks/audio-classification/inference.d.ts +3 -0
- package/dist/esm/tasks/audio-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/document-question-answering/inference.d.ts +0 -4
- package/dist/esm/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/esm/tasks/image-classification/inference.d.ts +3 -0
- package/dist/esm/tasks/image-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/index.d.ts +1 -1
- package/dist/esm/tasks/index.d.ts.map +1 -1
- package/dist/esm/tasks/text-classification/inference.d.ts +3 -0
- package/dist/esm/tasks/text-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-speech/data.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-speech/data.js +15 -7
- package/dist/esm/tasks/video-classification/inference.d.ts +3 -0
- package/dist/esm/tasks/video-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts +9 -19
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts +9 -19
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts +8 -12
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/local-apps.spec.ts +123 -0
- package/src/local-apps.ts +37 -18
- package/src/model-libraries-snippets.spec.ts +54 -0
- package/src/model-libraries-snippets.ts +24 -11
- package/src/model-libraries.ts +7 -0
- package/src/tasks/audio-classification/inference.ts +3 -0
- package/src/tasks/audio-classification/spec/input.json +2 -1
- package/src/tasks/document-question-answering/inference.ts +0 -4
- package/src/tasks/document-question-answering/spec/output.json +1 -8
- package/src/tasks/image-classification/inference.ts +3 -0
- package/src/tasks/image-classification/spec/input.json +2 -1
- package/src/tasks/index.ts +0 -1
- package/src/tasks/text-classification/inference.ts +3 -0
- package/src/tasks/text-classification/spec/input.json +2 -1
- package/src/tasks/text-to-speech/data.ts +15 -7
- package/src/tasks/video-classification/inference.ts +3 -0
- package/src/tasks/video-classification/spec/input.json +2 -1
- package/src/tasks/zero-shot-classification/inference.ts +9 -19
- package/src/tasks/zero-shot-classification/spec/input.json +13 -20
- package/src/tasks/zero-shot-image-classification/inference.ts +9 -19
- package/src/tasks/zero-shot-image-classification/spec/input.json +13 -19
- package/src/tasks/zero-shot-object-detection/inference.ts +8 -12
- package/src/tasks/zero-shot-object-detection/spec/input.json +13 -18
|
@@ -8,27 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotClassificationInput {
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The text to classify
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The input text data, with candidate labels
|
|
22
|
-
*/
|
|
23
|
-
export interface ZeroShotClassificationInputData {
|
|
24
|
-
/**
|
|
25
|
-
* The set of possible class labels to classify the text into.
|
|
26
|
-
*/
|
|
27
|
-
candidateLabels: string[];
|
|
28
|
-
/**
|
|
29
|
-
* The text to classify
|
|
30
|
-
*/
|
|
31
|
-
text: string;
|
|
17
|
+
parameters: ZeroShotClassificationParameters;
|
|
32
18
|
[property: string]: unknown;
|
|
33
19
|
}
|
|
34
20
|
/**
|
|
@@ -38,8 +24,12 @@ export interface ZeroShotClassificationInputData {
|
|
|
38
24
|
*/
|
|
39
25
|
export interface ZeroShotClassificationParameters {
|
|
40
26
|
/**
|
|
41
|
-
* The
|
|
42
|
-
|
|
27
|
+
* The set of possible class labels to classify the text into.
|
|
28
|
+
*/
|
|
29
|
+
candidate_labels: string[];
|
|
30
|
+
/**
|
|
31
|
+
* The sentence used in conjunction with `candidate_labels` to attempt the text
|
|
32
|
+
* classification by replacing the placeholder with the candidate labels.
|
|
43
33
|
*/
|
|
44
34
|
hypothesis_template?: string;
|
|
45
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,gCAAgC,CAAC;IAC7C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,EAAE,CAAC;AACjF;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -8,27 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotImageClassificationInput {
|
|
10
10
|
/**
|
|
11
|
-
* The input image data
|
|
11
|
+
* The input image data to classify as a base64-encoded string.
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The input image data, with candidate labels
|
|
22
|
-
*/
|
|
23
|
-
export interface ZeroShotImageClassificationInputData {
|
|
24
|
-
/**
|
|
25
|
-
* The candidate labels for this image
|
|
26
|
-
*/
|
|
27
|
-
candidateLabels: string[];
|
|
28
|
-
/**
|
|
29
|
-
* The image data to classify
|
|
30
|
-
*/
|
|
31
|
-
image: unknown;
|
|
17
|
+
parameters: ZeroShotImageClassificationParameters;
|
|
32
18
|
[property: string]: unknown;
|
|
33
19
|
}
|
|
34
20
|
/**
|
|
@@ -38,8 +24,12 @@ export interface ZeroShotImageClassificationInputData {
|
|
|
38
24
|
*/
|
|
39
25
|
export interface ZeroShotImageClassificationParameters {
|
|
40
26
|
/**
|
|
41
|
-
* The
|
|
42
|
-
|
|
27
|
+
* The candidate labels for this image
|
|
28
|
+
*/
|
|
29
|
+
candidate_labels: string[];
|
|
30
|
+
/**
|
|
31
|
+
* The sentence used in conjunction with `candidate_labels` to attempt the image
|
|
32
|
+
* classification by replacing the placeholder with the candidate labels.
|
|
43
33
|
*/
|
|
44
34
|
hypothesis_template?: string;
|
|
45
35
|
[property: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,qCAAqC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,iCAAiC,GAAG,wCAAwC,EAAE,CAAC;AAC3F;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACxD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -8,29 +8,25 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ZeroShotObjectDetectionInput {
|
|
10
10
|
/**
|
|
11
|
-
* The input image data
|
|
11
|
+
* The input image data as a base64-encoded string.
|
|
12
12
|
*/
|
|
13
|
-
inputs:
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
17
|
-
parameters
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
};
|
|
17
|
+
parameters: ZeroShotObjectDetectionParameters;
|
|
20
18
|
[property: string]: unknown;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Zero Shot Object Detection
|
|
24
24
|
*/
|
|
25
|
-
export interface
|
|
25
|
+
export interface ZeroShotObjectDetectionParameters {
|
|
26
26
|
/**
|
|
27
27
|
* The candidate labels for this image
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The image data to generate bounding boxes from
|
|
32
|
-
*/
|
|
33
|
-
image: unknown;
|
|
29
|
+
candidate_labels: string[];
|
|
34
30
|
[property: string]: unknown;
|
|
35
31
|
}
|
|
36
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-object-detection/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/zero-shot-object-detection/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,iCAAiC,CAAC;IAC9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CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;CACtD,GACD;IACA;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC;CACzG,CACH,CAAC;AAqBF,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,SAAS,WAE5C;AA+KD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;;;;;;yBApLS,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;yBA0CzC,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;oCA6JzD,SAAS;yBA5GX,SAAS,KAAG,eAAe,EAAE;;;;;;;yBAiD9B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBAxEzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBATjD,SAAS,aAAa,MAAM,KAAG,MAAM;;CAiR/B,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/esm/local-apps.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { parseGGUFQuantLabel } from "./gguf.js";
|
|
2
|
+
import { stringifyMessages } from "./snippets/common.js";
|
|
3
|
+
import { getModelInputSnippet } from "./snippets/inputs.js";
|
|
2
4
|
function isAwqModel(model) {
|
|
3
5
|
return model.config?.quantization_config?.quant_method === "awq";
|
|
4
6
|
}
|
|
@@ -24,14 +26,20 @@ function isMlxModel(model) {
|
|
|
24
26
|
return model.tags.includes("mlx");
|
|
25
27
|
}
|
|
26
28
|
const snippetLlamacpp = (model, filepath) => {
|
|
27
|
-
const command = (binary) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const command = (binary) => {
|
|
30
|
+
const snippet = [
|
|
31
|
+
"# Load and run the model:",
|
|
32
|
+
`${binary} \\`,
|
|
33
|
+
` --hf-repo "${model.id}" \\`,
|
|
34
|
+
` --hf-file ${filepath ?? "{{GGUF_FILE}}"} \\`,
|
|
35
|
+
` -p "${model.tags.includes("conversational") ? "You are a helpful assistant" : "Once upon a time,"}"`,
|
|
36
|
+
];
|
|
37
|
+
if (model.tags.includes("conversational")) {
|
|
38
|
+
snippet[snippet.length - 1] += " \\";
|
|
39
|
+
snippet.push(" --conversation");
|
|
40
|
+
}
|
|
41
|
+
return snippet.join("\n");
|
|
42
|
+
};
|
|
35
43
|
return [
|
|
36
44
|
{
|
|
37
45
|
title: "Install from brew",
|
|
@@ -102,22 +110,33 @@ const snippetLocalAI = (model, filepath) => {
|
|
|
102
110
|
];
|
|
103
111
|
};
|
|
104
112
|
const snippetVllm = (model) => {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
const messages = getModelInputSnippet(model);
|
|
114
|
+
const runCommandInstruct = `# Call the server using curl:
|
|
115
|
+
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
116
|
+
-H "Content-Type: application/json" \\
|
|
117
|
+
--data '{
|
|
118
|
+
"model": "${model.id}",
|
|
119
|
+
"messages": ${stringifyMessages(messages, {
|
|
120
|
+
indent: "\t\t",
|
|
121
|
+
attributeKeyQuotes: true,
|
|
122
|
+
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
123
|
+
})}
|
|
124
|
+
}'`;
|
|
125
|
+
const runCommandNonInstruct = `# Call the server using curl:
|
|
126
|
+
curl -X POST "http://localhost:8000/v1/completions" \\
|
|
127
|
+
-H "Content-Type: application/json" \\
|
|
128
|
+
--data '{
|
|
129
|
+
"model": "${model.id}",
|
|
130
|
+
"prompt": "Once upon a time,",
|
|
131
|
+
"max_tokens": 512,
|
|
132
|
+
"temperature": 0.5
|
|
133
|
+
}'`;
|
|
134
|
+
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
116
135
|
return [
|
|
117
136
|
{
|
|
118
137
|
title: "Install from pip",
|
|
119
138
|
setup: ["# Install vLLM from pip:", "pip install vllm"].join("\n"),
|
|
120
|
-
content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand
|
|
139
|
+
content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand],
|
|
121
140
|
},
|
|
122
141
|
{
|
|
123
142
|
title: "Use Docker images",
|
|
@@ -134,7 +153,7 @@ const snippetVllm = (model) => {
|
|
|
134
153
|
].join("\n"),
|
|
135
154
|
content: [
|
|
136
155
|
`# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
|
|
137
|
-
runCommand
|
|
156
|
+
runCommand,
|
|
138
157
|
],
|
|
139
158
|
},
|
|
140
159
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-apps.spec.d.ts","sourceRoot":"","sources":["../../src/local-apps.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { LOCAL_APPS } from "./local-apps.js";
|
|
3
|
+
describe("local-apps", () => {
|
|
4
|
+
it("llama.cpp conversational", async () => {
|
|
5
|
+
const { snippet: snippetFunc } = LOCAL_APPS["llama.cpp"];
|
|
6
|
+
const model = {
|
|
7
|
+
id: "bartowski/Llama-3.2-3B-Instruct-GGUF",
|
|
8
|
+
tags: ["conversational"],
|
|
9
|
+
inference: "",
|
|
10
|
+
};
|
|
11
|
+
const snippet = snippetFunc(model);
|
|
12
|
+
expect(snippet[0].content).toEqual(`# Load and run the model:
|
|
13
|
+
llama-cli \\
|
|
14
|
+
--hf-repo "bartowski/Llama-3.2-3B-Instruct-GGUF" \\
|
|
15
|
+
--hf-file {{GGUF_FILE}} \\
|
|
16
|
+
-p "You are a helpful assistant" \\
|
|
17
|
+
--conversation`);
|
|
18
|
+
});
|
|
19
|
+
it("llama.cpp non-conversational", async () => {
|
|
20
|
+
const { snippet: snippetFunc } = LOCAL_APPS["llama.cpp"];
|
|
21
|
+
const model = {
|
|
22
|
+
id: "mlabonne/gemma-2b-GGUF",
|
|
23
|
+
tags: [],
|
|
24
|
+
inference: "",
|
|
25
|
+
};
|
|
26
|
+
const snippet = snippetFunc(model);
|
|
27
|
+
expect(snippet[0].content).toEqual(`# Load and run the model:
|
|
28
|
+
llama-cli \\
|
|
29
|
+
--hf-repo "mlabonne/gemma-2b-GGUF" \\
|
|
30
|
+
--hf-file {{GGUF_FILE}} \\
|
|
31
|
+
-p "Once upon a time,"`);
|
|
32
|
+
});
|
|
33
|
+
it("vLLM conversational llm", async () => {
|
|
34
|
+
const { snippet: snippetFunc } = LOCAL_APPS["vllm"];
|
|
35
|
+
const model = {
|
|
36
|
+
id: "meta-llama/Llama-3.2-3B-Instruct",
|
|
37
|
+
pipeline_tag: "text-generation",
|
|
38
|
+
tags: ["conversational"],
|
|
39
|
+
inference: "",
|
|
40
|
+
};
|
|
41
|
+
const snippet = snippetFunc(model);
|
|
42
|
+
expect(snippet[0].content.join("\n")).toEqual(`# Load and run the model:
|
|
43
|
+
vllm serve "meta-llama/Llama-3.2-3B-Instruct"
|
|
44
|
+
# Call the server using curl:
|
|
45
|
+
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
46
|
+
-H "Content-Type: application/json" \\
|
|
47
|
+
--data '{
|
|
48
|
+
"model": "meta-llama/Llama-3.2-3B-Instruct",
|
|
49
|
+
"messages": [
|
|
50
|
+
{
|
|
51
|
+
"role": "user",
|
|
52
|
+
"content": "What is the capital of France?"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}'`);
|
|
56
|
+
});
|
|
57
|
+
it("vLLM non-conversational llm", async () => {
|
|
58
|
+
const { snippet: snippetFunc } = LOCAL_APPS["vllm"];
|
|
59
|
+
const model = {
|
|
60
|
+
id: "meta-llama/Llama-3.2-3B",
|
|
61
|
+
tags: [""],
|
|
62
|
+
inference: "",
|
|
63
|
+
};
|
|
64
|
+
const snippet = snippetFunc(model);
|
|
65
|
+
expect(snippet[0].content.join("\n")).toEqual(`# Load and run the model:
|
|
66
|
+
vllm serve "meta-llama/Llama-3.2-3B"
|
|
67
|
+
# Call the server using curl:
|
|
68
|
+
curl -X POST "http://localhost:8000/v1/completions" \\
|
|
69
|
+
-H "Content-Type: application/json" \\
|
|
70
|
+
--data '{
|
|
71
|
+
"model": "meta-llama/Llama-3.2-3B",
|
|
72
|
+
"prompt": "Once upon a time,",
|
|
73
|
+
"max_tokens": 512,
|
|
74
|
+
"temperature": 0.5
|
|
75
|
+
}'`);
|
|
76
|
+
});
|
|
77
|
+
it("vLLM conversational vlm", async () => {
|
|
78
|
+
const { snippet: snippetFunc } = LOCAL_APPS["vllm"];
|
|
79
|
+
const model = {
|
|
80
|
+
id: "meta-llama/Llama-3.2-11B-Vision-Instruct",
|
|
81
|
+
pipeline_tag: "image-text-to-text",
|
|
82
|
+
tags: ["conversational"],
|
|
83
|
+
inference: "",
|
|
84
|
+
};
|
|
85
|
+
const snippet = snippetFunc(model);
|
|
86
|
+
expect(snippet[0].content.join("\n")).toEqual(`# Load and run the model:
|
|
87
|
+
vllm serve "meta-llama/Llama-3.2-11B-Vision-Instruct"
|
|
88
|
+
# Call the server using curl:
|
|
89
|
+
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
90
|
+
-H "Content-Type: application/json" \\
|
|
91
|
+
--data '{
|
|
92
|
+
"model": "meta-llama/Llama-3.2-11B-Vision-Instruct",
|
|
93
|
+
"messages": [
|
|
94
|
+
{
|
|
95
|
+
"role": "user",
|
|
96
|
+
"content": [
|
|
97
|
+
{
|
|
98
|
+
"type": "text",
|
|
99
|
+
"text": "Describe this image in one sentence."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "image_url",
|
|
103
|
+
"image_url": {
|
|
104
|
+
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}'`);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkBjD,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAKjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAaF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,SAAS,KAAG,MAAM,EA6C1D,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAwBlD,CAAC;AAuCF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAUlD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,KAAG,MAAM,EAwCrD,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,SAAS,KAAG,MAAM,EAgBzD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,KAAG,MAAM,EAmBrD,CAAC;AAEF,eAAO,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ODE = "custom_code";
|
|
3
5
|
function nameWithoutNamespace(modelId) {
|
|
4
6
|
const splitted = modelId.split("/");
|
|
@@ -374,23 +376,32 @@ model = keras_hub.models.CausalLM.from_preset("hf://${model.id}", dtype="bfloat1
|
|
|
374
376
|
# full list here: https://keras.io/api/keras_hub/models/#api-documentation
|
|
375
377
|
`,
|
|
376
378
|
];
|
|
377
|
-
export const llama_cpp_python = (model) =>
|
|
378
|
-
|
|
379
|
+
export const llama_cpp_python = (model) => {
|
|
380
|
+
const snippets = [
|
|
381
|
+
`from llama_cpp import Llama
|
|
379
382
|
|
|
380
383
|
llm = Llama.from_pretrained(
|
|
381
384
|
repo_id="${model.id}",
|
|
382
385
|
filename="{{GGUF_FILE}}",
|
|
383
386
|
)
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
`,
|
|
388
|
+
];
|
|
389
|
+
if (model.tags.includes("conversational")) {
|
|
390
|
+
const messages = getModelInputSnippet(model);
|
|
391
|
+
snippets.push(`llm.create_chat_completion(
|
|
392
|
+
messages = ${stringifyMessages(messages, { attributeKeyQuotes: true, indent: "\t" })}
|
|
393
|
+
)`);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
snippets.push(`output = llm(
|
|
397
|
+
"Once upon a time,",
|
|
398
|
+
max_tokens=512,
|
|
399
|
+
echo=True
|
|
400
|
+
)
|
|
401
|
+
print(output)`);
|
|
402
|
+
}
|
|
403
|
+
return snippets;
|
|
404
|
+
};
|
|
394
405
|
export const tf_keras = (model) => [
|
|
395
406
|
`# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy)
|
|
396
407
|
# See https://github.com/keras-team/tf-keras for more details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-libraries-snippets.spec.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { llama_cpp_python } from "./model-libraries-snippets.js";
|
|
3
|
+
describe("model-libraries-snippets", () => {
|
|
4
|
+
it("llama_cpp_python conversational", async () => {
|
|
5
|
+
const model = {
|
|
6
|
+
id: "bartowski/Llama-3.2-3B-Instruct-GGUF",
|
|
7
|
+
pipeline_tag: "text-generation",
|
|
8
|
+
tags: ["conversational"],
|
|
9
|
+
inference: "",
|
|
10
|
+
};
|
|
11
|
+
const snippet = llama_cpp_python(model);
|
|
12
|
+
expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
|
|
13
|
+
|
|
14
|
+
llm = Llama.from_pretrained(
|
|
15
|
+
repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF",
|
|
16
|
+
filename="{{GGUF_FILE}}",
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
llm.create_chat_completion(
|
|
20
|
+
messages = [
|
|
21
|
+
{
|
|
22
|
+
"role": "user",
|
|
23
|
+
"content": "What is the capital of France?"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
)`);
|
|
27
|
+
});
|
|
28
|
+
it("llama_cpp_python non-conversational", async () => {
|
|
29
|
+
const model = {
|
|
30
|
+
id: "mlabonne/gemma-2b-GGUF",
|
|
31
|
+
tags: [""],
|
|
32
|
+
inference: "",
|
|
33
|
+
};
|
|
34
|
+
const snippet = llama_cpp_python(model);
|
|
35
|
+
expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
|
|
36
|
+
|
|
37
|
+
llm = Llama.from_pretrained(
|
|
38
|
+
repo_id="mlabonne/gemma-2b-GGUF",
|
|
39
|
+
filename="{{GGUF_FILE}}",
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
output = llm(
|
|
43
|
+
"Once upon a time,",
|
|
44
|
+
max_tokens=512,
|
|
45
|
+
echo=True
|
|
46
|
+
)
|
|
47
|
+
print(output)`);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -207,6 +207,13 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
207
207
|
repoUrl: string;
|
|
208
208
|
snippets: (model: ModelData) => string[];
|
|
209
209
|
};
|
|
210
|
+
clipscope: {
|
|
211
|
+
prettyLabel: string;
|
|
212
|
+
repoName: string;
|
|
213
|
+
repoUrl: string;
|
|
214
|
+
filter: false;
|
|
215
|
+
countDownloads: string;
|
|
216
|
+
};
|
|
210
217
|
cotracker: {
|
|
211
218
|
prettyLabel: string;
|
|
212
219
|
repoName: string;
|
|
@@ -800,5 +807,5 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
800
807
|
};
|
|
801
808
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
802
809
|
export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[];
|
|
803
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "depth-pro" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "f5-tts" | "genmo" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[];
|
|
810
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "depth-pro" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "f5-tts" | "genmo" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[];
|
|
804
811
|
//# sourceMappingURL=model-libraries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries.d.ts","sourceRoot":"","sources":["../../src/model-libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,EAAE,CAAC;IAC1C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"model-libraries.d.ts","sourceRoot":"","sources":["../../src/model-libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAA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;AAEpG,eAAO,MAAM,8BAA8B,y3CAQ1B,CAAC"}
|
|
@@ -168,6 +168,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
168
168
|
repoUrl: "https://github.com/cartesia-ai/cartesia_mlx",
|
|
169
169
|
snippets: snippets.cartesia_mlx,
|
|
170
170
|
},
|
|
171
|
+
clipscope: {
|
|
172
|
+
prettyLabel: "clipscope",
|
|
173
|
+
repoName: "clipscope",
|
|
174
|
+
repoUrl: "https://github.com/Lewington-pitsos/clipscope",
|
|
175
|
+
filter: false,
|
|
176
|
+
countDownloads: `path_extension:"pt"`,
|
|
177
|
+
},
|
|
171
178
|
cotracker: {
|
|
172
179
|
prettyLabel: "CoTracker",
|
|
173
180
|
repoName: "CoTracker",
|
|
@@ -24,6 +24,9 @@ export interface AudioClassificationInput {
|
|
|
24
24
|
* Additional inference parameters for Audio Classification
|
|
25
25
|
*/
|
|
26
26
|
export interface AudioClassificationParameters {
|
|
27
|
+
/**
|
|
28
|
+
* The function to apply to the model outputs in order to retrieve the scores.
|
|
29
|
+
*/
|
|
27
30
|
function_to_apply?: ClassificationOutputTransform;
|
|
28
31
|
/**
|
|
29
32
|
* When specified, limits the output to the top K most probable classes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -102,10 +102,6 @@ export interface DocumentQuestionAnsweringOutputElement {
|
|
|
102
102
|
* boxes).
|
|
103
103
|
*/
|
|
104
104
|
start: number;
|
|
105
|
-
/**
|
|
106
|
-
* The index of each word/box pair that is in the answer
|
|
107
|
-
*/
|
|
108
|
-
words: number[];
|
|
109
105
|
[property: string]: unknown;
|
|
110
106
|
}
|
|
111
107
|
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/document-question-answering/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,MAAM,EAAE,kCAAkC,CAAC;IAC3C;;OAEG;IACH,UAAU,CAAC,EAAE,mCAAmC,CAAC;IACjD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAClD;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,mCAAmC;IACnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,+BAA+B,GAAG,sCAAsC,EAAE,CAAC;AACvF;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACtD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/document-question-answering/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,MAAM,EAAE,kCAAkC,CAAC;IAC3C;;OAEG;IACH,UAAU,CAAC,EAAE,mCAAmC,CAAC;IACjD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAClD;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,mCAAmC;IACnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,+BAA+B,GAAG,sCAAsC,EAAE,CAAC;AACvF;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACtD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -24,6 +24,9 @@ export interface ImageClassificationInput {
|
|
|
24
24
|
* Additional inference parameters for Image Classification
|
|
25
25
|
*/
|
|
26
26
|
export interface ImageClassificationParameters {
|
|
27
|
+
/**
|
|
28
|
+
* The function to apply to the model outputs in order to retrieve the scores.
|
|
29
|
+
*/
|
|
27
30
|
function_to_apply?: ClassificationOutputTransform;
|
|
28
31
|
/**
|
|
29
32
|
* When specified, limits the output to the top K most probable classes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|