@huggingface/tasks
Version:
List of ML tasks for huggingface.co/tasks
64 lines (63 loc) • 1.47 kB
text/typescript
/**
* Inference code generated from the JSON schema spec in ./spec
*
* Using src/scripts/inference-codegen
*/
/**
* Inputs for Translation inference
*/
export interface TranslationInput {
/**
* The text to translate.
*/
inputs: string;
/**
* Additional inference parameters for Translation
*/
parameters?: TranslationParameters;
[]: unknown;
}
/**
* Additional inference parameters for Translation
*/
export interface TranslationParameters {
/**
* Whether to clean up the potential extra spaces in the text output.
*/
clean_up_tokenization_spaces?: boolean;
/**
* Additional parametrization of the text generation algorithm.
*/
generate_parameters?: {
[]: unknown;
};
/**
* The source language of the text. Required for models that can translate from multiple
* languages.
*/
src_lang?: string;
/**
* Target language to translate to. Required for models that can translate to multiple
* languages.
*/
tgt_lang?: string;
/**
* The truncation strategy to use.
*/
truncation?: TranslationTruncationStrategy;
[]: unknown;
}
/**
* The truncation strategy to use.
*/
export type TranslationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
/**
* Outputs of inference for the Translation task
*/
export interface TranslationOutput {
/**
* The translated text.
*/
translation_text: string;
[]: unknown;
}