Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
machineuser
commited on
Commit
·
989afe0
1
Parent(s):
7db0454
Sync widgets demo
Browse files
packages/tasks/src/tasks/summarization/inference.ts
CHANGED
|
@@ -45,15 +45,12 @@ export interface Text2TextGenerationParameters {
|
|
| 45 |
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
| 46 |
|
| 47 |
/**
|
| 48 |
-
* Outputs for Summarization
|
| 49 |
-
*
|
| 50 |
-
* Outputs of inference for the Text2text Generation task
|
| 51 |
*/
|
| 52 |
export interface SummarizationOutput {
|
| 53 |
-
generatedText: unknown;
|
| 54 |
/**
|
| 55 |
-
* The
|
| 56 |
*/
|
| 57 |
-
|
| 58 |
[property: string]: unknown;
|
| 59 |
}
|
|
|
|
| 45 |
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
| 46 |
|
| 47 |
/**
|
| 48 |
+
* Outputs of inference for the Summarization task
|
|
|
|
|
|
|
| 49 |
*/
|
| 50 |
export interface SummarizationOutput {
|
|
|
|
| 51 |
/**
|
| 52 |
+
* The summarized text.
|
| 53 |
*/
|
| 54 |
+
summary_text: string;
|
| 55 |
[property: string]: unknown;
|
| 56 |
}
|
packages/tasks/src/tasks/summarization/spec/output.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
{
|
| 2 |
-
"$ref": "/inference/schemas/text2text-generation/output.json",
|
| 3 |
"$id": "/inference/schemas/summarization/output.json",
|
| 4 |
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
|
|
| 5 |
"title": "SummarizationOutput",
|
| 6 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"$id": "/inference/schemas/summarization/output.json",
|
| 3 |
"$schema": "http://json-schema.org/draft-06/schema#",
|
| 4 |
+
"description": "Outputs of inference for the Summarization task",
|
| 5 |
"title": "SummarizationOutput",
|
| 6 |
+
"type": "object",
|
| 7 |
+
"properties": {
|
| 8 |
+
"summary_text": {
|
| 9 |
+
"type": "string",
|
| 10 |
+
"description": "The summarized text."
|
| 11 |
+
}
|
| 12 |
+
},
|
| 13 |
+
"required": ["summary_text"]
|
| 14 |
}
|
packages/tasks/src/tasks/translation/inference.ts
CHANGED
|
@@ -45,15 +45,12 @@ export interface Text2TextGenerationParameters {
|
|
| 45 |
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
| 46 |
|
| 47 |
/**
|
| 48 |
-
* Outputs for Translation
|
| 49 |
-
*
|
| 50 |
-
* Outputs of inference for the Text2text Generation task
|
| 51 |
*/
|
| 52 |
export interface TranslationOutput {
|
| 53 |
-
generatedText: unknown;
|
| 54 |
/**
|
| 55 |
-
* The
|
| 56 |
*/
|
| 57 |
-
|
| 58 |
[property: string]: unknown;
|
| 59 |
}
|
|
|
|
| 45 |
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
| 46 |
|
| 47 |
/**
|
| 48 |
+
* Outputs of inference for the Translation task
|
|
|
|
|
|
|
| 49 |
*/
|
| 50 |
export interface TranslationOutput {
|
|
|
|
| 51 |
/**
|
| 52 |
+
* The translated text.
|
| 53 |
*/
|
| 54 |
+
translation_text: string;
|
| 55 |
[property: string]: unknown;
|
| 56 |
}
|
packages/tasks/src/tasks/translation/spec/output.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
{
|
| 2 |
-
"$ref": "/inference/schemas/text2text-generation/output.json",
|
| 3 |
"$id": "/inference/schemas/translation/output.json",
|
| 4 |
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
|
|
| 5 |
"title": "TranslationOutput",
|
| 6 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"$id": "/inference/schemas/translation/output.json",
|
| 3 |
"$schema": "http://json-schema.org/draft-06/schema#",
|
| 4 |
+
"description": "Outputs of inference for the Translation task",
|
| 5 |
"title": "TranslationOutput",
|
| 6 |
+
"type": "object",
|
| 7 |
+
"properties": {
|
| 8 |
+
"translation_text": {
|
| 9 |
+
"type": "string",
|
| 10 |
+
"description": "The translated text."
|
| 11 |
+
}
|
| 12 |
+
},
|
| 13 |
+
"required": ["translation_text"]
|
| 14 |
}
|