@huggingface/tasks 0.19.22 → 0.19.24
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/library-to-tasks.d.ts.map +1 -1
- package/dist/commonjs/library-to-tasks.js +1 -8
- package/dist/commonjs/model-libraries-snippets.d.ts +3 -0
- package/dist/commonjs/model-libraries-snippets.d.ts.map +1 -1
- package/dist/commonjs/model-libraries-snippets.js +34 -2
- package/dist/commonjs/model-libraries.d.ts +35 -1
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +34 -0
- package/dist/commonjs/pipelines.d.ts +1 -9
- package/dist/commonjs/pipelines.d.ts.map +1 -1
- package/dist/commonjs/pipelines.js +4 -6
- package/dist/commonjs/snippets/inputs.d.ts.map +1 -1
- package/dist/commonjs/snippets/inputs.js +0 -2
- package/dist/commonjs/tasks/chat-completion/inference.d.ts +1 -1
- package/dist/commonjs/tasks/chat-completion/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/index.d.ts.map +1 -1
- package/dist/commonjs/tasks/index.js +0 -2
- package/dist/commonjs/tasks/placeholder/data.js +1 -1
- package/dist/commonjs/tasks/summarization/data.js +1 -1
- package/dist/commonjs/tasks/translation/data.js +1 -1
- package/dist/esm/library-to-tasks.d.ts.map +1 -1
- package/dist/esm/library-to-tasks.js +1 -8
- package/dist/esm/model-libraries-snippets.d.ts +3 -0
- package/dist/esm/model-libraries-snippets.d.ts.map +1 -1
- package/dist/esm/model-libraries-snippets.js +29 -0
- package/dist/esm/model-libraries.d.ts +35 -1
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +34 -0
- package/dist/esm/pipelines.d.ts +1 -9
- package/dist/esm/pipelines.d.ts.map +1 -1
- package/dist/esm/pipelines.js +4 -6
- package/dist/esm/snippets/inputs.d.ts.map +1 -1
- package/dist/esm/snippets/inputs.js +0 -2
- package/dist/esm/tasks/chat-completion/inference.d.ts +1 -1
- package/dist/esm/tasks/chat-completion/inference.d.ts.map +1 -1
- package/dist/esm/tasks/index.d.ts.map +1 -1
- package/dist/esm/tasks/index.js +0 -2
- package/dist/esm/tasks/placeholder/data.js +1 -1
- package/dist/esm/tasks/summarization/data.js +1 -1
- package/dist/esm/tasks/translation/data.js +1 -1
- package/package.json +1 -1
- package/src/library-to-tasks.ts +1 -8
- package/src/model-libraries-snippets.ts +32 -0
- package/src/model-libraries.ts +34 -0
- package/src/pipelines.ts +4 -6
- package/src/snippets/inputs.ts +0 -3
- package/src/tasks/chat-completion/inference.ts +1 -1
- package/src/tasks/chat-completion/spec/input.json +1 -1
- package/src/tasks/index.ts +0 -2
- package/src/tasks/placeholder/data.ts +1 -1
- package/src/tasks/summarization/data.ts +1 -1
- package/src/tasks/text-generation/about.md +2 -2
- package/src/tasks/translation/data.ts +1 -1
- package/dist/commonjs/tasks/text2text-generation/inference.d.ts +0 -52
- package/dist/commonjs/tasks/text2text-generation/inference.d.ts.map +0 -1
- package/dist/commonjs/tasks/text2text-generation/inference.js +0 -2
- package/dist/esm/tasks/text2text-generation/inference.d.ts +0 -52
- package/dist/esm/tasks/text2text-generation/inference.d.ts.map +0 -1
- package/dist/esm/tasks/text2text-generation/inference.js +0 -1
- package/src/tasks/text2text-generation/inference.ts +0 -51
- package/src/tasks/text2text-generation/spec/input.json +0 -54
- package/src/tasks/text2text-generation/spec/output.json +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
This task covers guides on both [text-generation](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads) and [text-to-text generation](https://huggingface.co/models?
|
|
1
|
+
This task covers guides on both [text-generation](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads) and [text-to-text generation](https://huggingface.co/models?other=text2text-generation&sort=downloads) models. Popular large language models that are used for chats or following instructions are also covered in this task. You can find the list of selected open-source large language models [here](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard), ranked by their performance scores.
|
|
2
2
|
|
|
3
3
|
## Use Cases
|
|
4
4
|
|
|
@@ -58,7 +58,7 @@ generator("Hello, I'm a language model", max_length = 30, num_return_sequences=3
|
|
|
58
58
|
## {'generated_text': "Hello, I'm a language modeler. I write and maintain software in Python. I love to code, and that includes coding things that require writing"}, ...
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
[Text-to-Text generation models](https://huggingface.co/models?
|
|
61
|
+
[Text-to-Text generation models](https://huggingface.co/models?other=text2text-generation&sort=downloads) have a separate pipeline called `text2text-generation`. This pipeline takes an input containing the sentence including the task and returns the output of the accomplished task.
|
|
62
62
|
|
|
63
63
|
```python
|
|
64
64
|
from transformers import pipeline
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TaskDataCustom } from "../index.js";
|
|
2
2
|
|
|
3
3
|
const taskData: TaskDataCustom = {
|
|
4
|
-
canonicalId: "
|
|
4
|
+
canonicalId: "text-generation",
|
|
5
5
|
datasets: [
|
|
6
6
|
{
|
|
7
7
|
description: "A dataset of copyright-free books translated into 16 different languages.",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
-
*
|
|
4
|
-
* Using src/scripts/inference-codegen
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Inputs for Text2text Generation inference
|
|
8
|
-
*/
|
|
9
|
-
export interface Text2TextGenerationInput {
|
|
10
|
-
/**
|
|
11
|
-
* The input text data
|
|
12
|
-
*/
|
|
13
|
-
inputs: string;
|
|
14
|
-
/**
|
|
15
|
-
* Additional inference parameters for Text2text Generation
|
|
16
|
-
*/
|
|
17
|
-
parameters?: Text2TextGenerationParameters;
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Additional inference parameters for Text2text Generation
|
|
22
|
-
*/
|
|
23
|
-
export interface Text2TextGenerationParameters {
|
|
24
|
-
/**
|
|
25
|
-
* Whether to clean up the potential extra spaces in the text output.
|
|
26
|
-
*/
|
|
27
|
-
clean_up_tokenization_spaces?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Additional parametrization of the text generation algorithm
|
|
30
|
-
*/
|
|
31
|
-
generate_parameters?: {
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The truncation strategy to use
|
|
36
|
-
*/
|
|
37
|
-
truncation?: Text2TextGenerationTruncationStrategy;
|
|
38
|
-
[property: string]: unknown;
|
|
39
|
-
}
|
|
40
|
-
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
|
41
|
-
/**
|
|
42
|
-
* Outputs of inference for the Text2text Generation task
|
|
43
|
-
*/
|
|
44
|
-
export interface Text2TextGenerationOutput {
|
|
45
|
-
generatedText: unknown;
|
|
46
|
-
/**
|
|
47
|
-
* The generated text.
|
|
48
|
-
*/
|
|
49
|
-
generated_text?: string;
|
|
50
|
-
[property: string]: unknown;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text2text-generation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,UAAU,CAAC,EAAE,qCAAqC,CAAC;IACnD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AACvH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
-
*
|
|
4
|
-
* Using src/scripts/inference-codegen
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Inputs for Text2text Generation inference
|
|
8
|
-
*/
|
|
9
|
-
export interface Text2TextGenerationInput {
|
|
10
|
-
/**
|
|
11
|
-
* The input text data
|
|
12
|
-
*/
|
|
13
|
-
inputs: string;
|
|
14
|
-
/**
|
|
15
|
-
* Additional inference parameters for Text2text Generation
|
|
16
|
-
*/
|
|
17
|
-
parameters?: Text2TextGenerationParameters;
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Additional inference parameters for Text2text Generation
|
|
22
|
-
*/
|
|
23
|
-
export interface Text2TextGenerationParameters {
|
|
24
|
-
/**
|
|
25
|
-
* Whether to clean up the potential extra spaces in the text output.
|
|
26
|
-
*/
|
|
27
|
-
clean_up_tokenization_spaces?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Additional parametrization of the text generation algorithm
|
|
30
|
-
*/
|
|
31
|
-
generate_parameters?: {
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The truncation strategy to use
|
|
36
|
-
*/
|
|
37
|
-
truncation?: Text2TextGenerationTruncationStrategy;
|
|
38
|
-
[property: string]: unknown;
|
|
39
|
-
}
|
|
40
|
-
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
|
41
|
-
/**
|
|
42
|
-
* Outputs of inference for the Text2text Generation task
|
|
43
|
-
*/
|
|
44
|
-
export interface Text2TextGenerationOutput {
|
|
45
|
-
generatedText: unknown;
|
|
46
|
-
/**
|
|
47
|
-
* The generated text.
|
|
48
|
-
*/
|
|
49
|
-
generated_text?: string;
|
|
50
|
-
[property: string]: unknown;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text2text-generation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,UAAU,CAAC,EAAE,qCAAqC,CAAC;IACnD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AACvH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
-
*
|
|
4
|
-
* Using src/scripts/inference-codegen
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Inputs for Text2text Generation inference
|
|
8
|
-
*/
|
|
9
|
-
export interface Text2TextGenerationInput {
|
|
10
|
-
/**
|
|
11
|
-
* The input text data
|
|
12
|
-
*/
|
|
13
|
-
inputs: string;
|
|
14
|
-
/**
|
|
15
|
-
* Additional inference parameters for Text2text Generation
|
|
16
|
-
*/
|
|
17
|
-
parameters?: Text2TextGenerationParameters;
|
|
18
|
-
[property: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Additional inference parameters for Text2text Generation
|
|
22
|
-
*/
|
|
23
|
-
export interface Text2TextGenerationParameters {
|
|
24
|
-
/**
|
|
25
|
-
* Whether to clean up the potential extra spaces in the text output.
|
|
26
|
-
*/
|
|
27
|
-
clean_up_tokenization_spaces?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Additional parametrization of the text generation algorithm
|
|
30
|
-
*/
|
|
31
|
-
generate_parameters?: {
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The truncation strategy to use
|
|
36
|
-
*/
|
|
37
|
-
truncation?: Text2TextGenerationTruncationStrategy;
|
|
38
|
-
[property: string]: unknown;
|
|
39
|
-
}
|
|
40
|
-
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
|
41
|
-
/**
|
|
42
|
-
* Outputs of inference for the Text2text Generation task
|
|
43
|
-
*/
|
|
44
|
-
export interface Text2TextGenerationOutput {
|
|
45
|
-
generatedText: unknown;
|
|
46
|
-
/**
|
|
47
|
-
* The generated text.
|
|
48
|
-
*/
|
|
49
|
-
generated_text?: string;
|
|
50
|
-
[property: string]: unknown;
|
|
51
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "/inference/schemas/text2text-generation/input.json",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
|
-
"description": "Inputs for Text2text Generation inference",
|
|
5
|
-
"title": "Text2TextGenerationInput",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"inputs": {
|
|
9
|
-
"description": "The input text data",
|
|
10
|
-
"type": "string"
|
|
11
|
-
},
|
|
12
|
-
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters for Text2text Generation",
|
|
14
|
-
"$ref": "#/$defs/Text2textGenerationParameters"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"$defs": {
|
|
18
|
-
"Text2textGenerationParameters": {
|
|
19
|
-
"title": "Text2textGenerationParameters",
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"clean_up_tokenization_spaces": {
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"description": "Whether to clean up the potential extra spaces in the text output."
|
|
25
|
-
},
|
|
26
|
-
"truncation": {
|
|
27
|
-
"title": "Text2textGenerationTruncationStrategy",
|
|
28
|
-
"type": "string",
|
|
29
|
-
"description": "The truncation strategy to use",
|
|
30
|
-
"oneOf": [
|
|
31
|
-
{
|
|
32
|
-
"const": "do_not_truncate"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"const": "longest_first"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"const": "only_first"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"const": "only_second"
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
"generate_parameters": {
|
|
46
|
-
"title": "generateParameters",
|
|
47
|
-
"type": "object",
|
|
48
|
-
"description": "Additional parametrization of the text generation algorithm"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"required": ["inputs"]
|
|
54
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "/inference/schemas/text2text-generation/output.json",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
|
-
"description": "Outputs of inference for the Text2text Generation task",
|
|
5
|
-
"title": "Text2TextGenerationOutput",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"generated_text": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "The generated text."
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"required": ["generatedText"]
|
|
14
|
-
}
|