Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
machineuser commited on
Commit ·
a6b2d88
1
Parent(s): 27a1c11
Sync widgets demo
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- packages/tasks/scripts/inference-codegen.ts+1-1
- packages/tasks/src/tasks/audio-classification/inference.ts+3-3
- packages/tasks/src/tasks/audio-classification/spec/input.json+2-2
- packages/tasks/src/tasks/audio-classification/spec/output.json+1-12
- packages/tasks/src/tasks/automatic-speech-recognition/inference.ts+34-29
- packages/tasks/src/tasks/automatic-speech-recognition/spec/input.json+1-1
- packages/tasks/src/tasks/automatic-speech-recognition/spec/output.json+30-28
- packages/tasks/src/tasks/common-definitions.json+25-17
- packages/tasks/src/tasks/depth-estimation/inference.ts+1-1
- packages/tasks/src/tasks/document-question-answering/inference.ts+15-7
- packages/tasks/src/tasks/document-question-answering/spec/input.json+7-7
- packages/tasks/src/tasks/document-question-answering/spec/output.json+2-2
- packages/tasks/src/tasks/fill-mask/inference.ts+3-2
- packages/tasks/src/tasks/fill-mask/spec/input.json+1-1
- packages/tasks/src/tasks/fill-mask/spec/output.json+1-1
- packages/tasks/src/tasks/image-classification/inference.ts+2-2
- packages/tasks/src/tasks/image-classification/spec/input.json+2-2
- packages/tasks/src/tasks/image-segmentation/inference.ts+2-2
- packages/tasks/src/tasks/image-segmentation/spec/input.json+2-2
- packages/tasks/src/tasks/image-to-image/inference.ts+4-4
- packages/tasks/src/tasks/image-to-image/spec/input.json+4-4
- packages/tasks/src/tasks/image-to-text/inference.ts+24-19
- packages/tasks/src/tasks/image-to-text/spec/input.json+1-1
- packages/tasks/src/tasks/image-to-text/spec/output.json+8-11
- packages/tasks/src/tasks/placeholder/spec/input.json+2-2
- packages/tasks/src/tasks/placeholder/spec/output.json+1-1
- packages/tasks/src/tasks/question-answering/inference.ts+7-7
- packages/tasks/src/tasks/question-answering/spec/input.json+7-7
- packages/tasks/src/tasks/summarization/inference.ts+4-3
- packages/tasks/src/tasks/text-classification/inference.ts+2-2
- packages/tasks/src/tasks/text-classification/spec/input.json+2-2
- packages/tasks/src/tasks/text-generation/inference.ts+14-11
- packages/tasks/src/tasks/text-generation/spec/input.json+8-8
- packages/tasks/src/tasks/text-generation/spec/output.json+8-11
- packages/tasks/src/tasks/text-to-audio/inference.ts+23-18
- packages/tasks/src/tasks/text-to-audio/spec/output.json+10-13
- packages/tasks/src/tasks/text-to-image/inference.ts+5-7
- packages/tasks/src/tasks/text-to-image/spec/input.json+4-4
- packages/tasks/src/tasks/text-to-image/spec/output.json+7-9
- packages/tasks/src/tasks/text-to-speech/inference.ts+17-16
- packages/tasks/src/tasks/text2text-generation/inference.ts+9-7
- packages/tasks/src/tasks/text2text-generation/spec/input.json+2-2
- packages/tasks/src/tasks/text2text-generation/spec/output.json+8-11
- packages/tasks/src/tasks/token-classification/inference.ts+3-3
- packages/tasks/src/tasks/token-classification/spec/input.json+2-2
- packages/tasks/src/tasks/token-classification/spec/output.json+1-1
- packages/tasks/src/tasks/translation/inference.ts+4-3
- packages/tasks/src/tasks/video-classification/inference.ts+4-4
- packages/tasks/src/tasks/video-classification/spec/input.json+4-4
- packages/tasks/src/tasks/visual-question-answering/inference.ts+1-1
56 unmodified lines5758596061626356 unmodified linesindentation: "\t",rendererOptions: {"just-types": true,"nice-property-names": true,"prefer-unions": true,"prefer-const-values": true,"prefer-unknown": true,56 unmodified lines5758596061626356 unmodified linesindentation: "\t",rendererOptions: {"just-types": true,"nice-property-names": false,"prefer-unions": true,"prefer-const-values": true,"prefer-unknown": true,
22 unmodified lines23242526272829303132336 unmodified lines4041424344454622 unmodified lines* Additional inference parameters for Audio Classification*/export interface AudioClassificationParameters {functionToApply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/topK?: number;[property: string]: unknown;}/**6 unmodified lines*/export interface AudioClassificationOutputElement {/*** The predicted class label (model specific).*/label: string;/**22 unmodified lines23242526272829303132336 unmodified lines4041424344454622 unmodified lines* Additional inference parameters for Audio Classification*/export interface AudioClassificationParameters {function_to_apply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/top_k?: number;[property: string]: unknown;}/**6 unmodified lines*/export interface AudioClassificationOutputElement {/*** The predicted class label.*/label: string;/**
18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Audio Classification","type": "object","properties": {"functionToApply": {"title": "AudioClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"topK": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Audio Classification","type": "object","properties": {"function_to_apply": {"title": "AudioClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"top_k": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}
4 unmodified lines567891011121314151617181920214 unmodified lines"description": "Outputs for Audio Classification inference","type": "array","items": {"type": "object","properties": {"label": {"type": "string","description": "The predicted class label (model specific)."},"score": {"type": "number","description": "The corresponding probability."}},"required": ["label", "score"]}}4 unmodified lines56789104 unmodified lines"description": "Outputs for Audio Classification inference","type": "array","items": {"$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutput"}}
2 unmodified lines3456788 unmodified lines1718192021227 unmodified lines3031323334353637383 unmodified lines4243444546474849505152535455565758593 unmodified lines636465666768697071727374757677787980818283848586878889909192939495969798991 unmodified line1011021031041051061071081091101111121 unmodified line1141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451465 unmodified lines1521531542 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Automatic Speech Recognition inference*/8 unmodified linesparameters?: AutomaticSpeechRecognitionParameters;[property: string]: unknown;}/*** Additional inference parameters*7 unmodified lines/*** Whether to output corresponding timestamps with the generated text*/returnTimestamps?: boolean;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/doSample?: boolean;/*** Controls the stopping condition for beam-based methods.*/earlyStopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilonCutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/etaCutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/maxLength?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/maxNewTokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/minLength?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/minNewTokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/numBeamGroups?: number;/*** Number of beams to use for beam search.*/numBeams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penaltyAlpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/topK?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/topP?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typicalP?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/useCache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";export interface AutomaticSpeechRecognitionOutputChunk {/*** A chunk of text identified by the model*/text: string;/*** The start and end timestamps corresponding with the text*/timestamps: number[];[property: string]: unknown;}export type AutomaticSpeechRecognitionOutput = AutomaticSpeechRecognitionOutputElement[];/*** Outputs of inference for the Automatic Speech Recognition task*/export interface AutomaticSpeechRecognitionOutputElement {/*** When returnTimestamps is enabled, chunks contains a list of audio chunks identified by* the model.5 unmodified linestext: string;[property: string]: unknown;}2 unmodified lines34567898 unmodified lines181920212223247 unmodified lines323334353637383940413 unmodified lines4546474849505152535455565758596061623 unmodified lines666768697071727374757677787980818283848586878889909192939495969798991001011021 unmodified line1041051061071081091101111121131141151 unmodified line1171181191201211221231241251261271281291301311321331341351361371381395 unmodified lines1451461471481491501511521531541551561571581592 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Automatic Speech Recognition inference*/8 unmodified linesparameters?: AutomaticSpeechRecognitionParameters;[property: string]: unknown;}/*** Additional inference parameters*7 unmodified lines/*** Whether to output corresponding timestamps with the generated text*/return_timestamps?: boolean;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/do_sample?: boolean;/*** Controls the stopping condition for beam-based methods.*/early_stopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilon_cutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/eta_cutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/max_length?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/max_new_tokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/min_length?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/min_new_tokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/num_beam_groups?: number;/*** Number of beams to use for beam search.*/num_beams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penalty_alpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/top_k?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/top_p?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typical_p?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/use_cache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";/*** Outputs of inference for the Automatic Speech Recognition task*/export interface AutomaticSpeechRecognitionOutput {/*** When returnTimestamps is enabled, chunks contains a list of audio chunks identified by* the model.5 unmodified linestext: string;[property: string]: unknown;}export interface AutomaticSpeechRecognitionOutputChunk {/*** A chunk of text identified by the model*/text: string;/*** The start and end timestamps corresponding with the text*/timestamps: number[];[property: string]: unknown;}
18 unmodified lines1920212223242518 unmodified lines"description": "Additional inference parameters for Automatic Speech Recognition","type": "object","properties": {"returnTimestamps": {"type": "boolean","description": "Whether to output corresponding timestamps with the generated text"},18 unmodified lines1920212223242518 unmodified lines"description": "Additional inference parameters for Automatic Speech Recognition","type": "object","properties": {"return_timestamps": {"type": "boolean","description": "Whether to output corresponding timestamps with the generated text"},
2 unmodified lines34567891011121314151617181920212223242526272829303132333435362 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Automatic Speech Recognition task","title": "AutomaticSpeechRecognitionOutput","type": "array","items": {"type": "object","properties": {"text": {"type": "string","description": "The recognized text."},"chunks": {"type": "array","description": "When returnTimestamps is enabled, chunks contains a list of audio chunks identified by the model.","items": {"type": "object","title": "AutomaticSpeechRecognitionOutputChunk","properties": {"text": { "type": "string", "description": "A chunk of text identified by the model" },"timestamps": {"type": "array","description": "The start and end timestamps corresponding with the text","items": { "type": "number" },"minLength": 2,"maxLength": 2}},"required": ["text", "timestamps"]}}},"required": ["text"]}}2 unmodified lines345678910111213141516171819202122232425262728293031323334353637382 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Automatic Speech Recognition task","title": "AutomaticSpeechRecognitionOutput","type": "object","properties": {"text": {"type": "string","description": "The recognized text."},"chunks": {"type": "array","description": "When returnTimestamps is enabled, chunks contains a list of audio chunks identified by the model.","items": {"type": "object","title": "AutomaticSpeechRecognitionOutputChunk","properties": {"text": {"type": "string","description": "A chunk of text identified by the model"},"timestamps": {"type": "array","description": "The start and end timestamps corresponding with the text","items": {"type": "number"},"minLength": 2,"maxLength": 2}},"required": ["text", "timestamps"]}}},"required": ["text"]}
42 unmodified lines43444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410542 unmodified lines"type": "number","description": "The value used to modulate the next token probabilities."},"topK": {"type": "integer","description": "The number of highest probability vocabulary tokens to keep for top-k-filtering."},"topP": {"type": "number","description": "If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation."},"typicalP": {"type": "number","description": " Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details."},"epsilonCutoff": {"type": "number","description": "If set to float strictly between 0 and 1, only tokens with a conditional probability greater than epsilon_cutoff will be sampled. In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."},"etaCutoff": {"type": "number","description": "Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to float strictly between 0 and 1, a token is only considered if it is greater than either eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."},"maxLength": {"type": "integer","description": "The maximum length (in tokens) of the generated text, including the input."},"maxNewTokens": {"type": "integer","description": "The maximum number of tokens to generate. Takes precedence over maxLength."},"minLength": {"type": "integer","description": "The minimum length (in tokens) of the generated text, including the input."},"minNewTokens": {"type": "integer","description": "The minimum number of tokens to generate. Takes precedence over maxLength."},"doSample": {"type": "boolean","description": "Whether to use sampling instead of greedy decoding when generating new tokens."},"earlyStopping": {"description": "Controls the stopping condition for beam-based methods.","oneOf": [{ "type": "boolean" }, { "const": "never", "type": "string" }]},"numBeams": {"type": "integer","description": "Number of beams to use for beam search."},"numBeamGroups": {"type": "integer","description": "Number of groups to divide num_beams into in order to ensure diversity among different groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details."},"penaltyAlpha": {"type": "number","description": "The value balances the model confidence and the degeneration penalty in contrastive search decoding."},"useCache": {"type": "boolean","description": "Whether the model should use the past last key/values attentions to speed up decoding"}42 unmodified lines43444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211342 unmodified lines"type": "number","description": "The value used to modulate the next token probabilities."},"top_k": {"type": "integer","description": "The number of highest probability vocabulary tokens to keep for top-k-filtering."},"top_p": {"type": "number","description": "If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation."},"typical_p": {"type": "number","description": " Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details."},"epsilon_cutoff": {"type": "number","description": "If set to float strictly between 0 and 1, only tokens with a conditional probability greater than epsilon_cutoff will be sampled. In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."},"eta_cutoff": {"type": "number","description": "Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to float strictly between 0 and 1, a token is only considered if it is greater than either eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."},"max_length": {"type": "integer","description": "The maximum length (in tokens) of the generated text, including the input."},"max_new_tokens": {"type": "integer","description": "The maximum number of tokens to generate. Takes precedence over maxLength."},"min_length": {"type": "integer","description": "The minimum length (in tokens) of the generated text, including the input."},"min_new_tokens": {"type": "integer","description": "The minimum number of tokens to generate. Takes precedence over maxLength."},"do_sample": {"type": "boolean","description": "Whether to use sampling instead of greedy decoding when generating new tokens."},"early_stopping": {"description": "Controls the stopping condition for beam-based methods.","oneOf": [{"type": "boolean"},{"const": "never","type": "string"}]},"num_beams": {"type": "integer","description": "Number of beams to use for beam search."},"num_beam_groups": {"type": "integer","description": "Number of groups to divide num_beams into in order to ensure diversity among different groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details."},"penalty_alpha": {"type": "number","description": "The value balances the model confidence and the degeneration penalty in contrastive search decoding."},"use_cache": {"type": "boolean","description": "Whether the model should use the past last key/values attentions to speed up decoding"}
29 unmodified lines30313233343529 unmodified lines/*** The predicted depth as a tensor*/predictedDepth?: unknown;[property: string]: unknown;}29 unmodified lines30313233343529 unmodified lines/*** The predicted depth as a tensor*/predicted_depth?: unknown;[property: string]: unknown;}
41 unmodified lines42434445464748495051522 unmodified lines5556575859606162636465666768697071727374757677787980816 unmodified lines888990919293949596979841 unmodified lines* be split in several chunks with some overlap. This argument controls the size of that* overlap.*/docStride?: number;/*** Whether to accept impossible as an answer*/handleImpossibleAnswer?: boolean;/*** Language to use while running OCR. Defaults to english.*/2 unmodified lines* The maximum length of predicted answers (e.g., only answers with a shorter length are* considered).*/maxAnswerLen?: number;/*** The maximum length of the question after tokenization. It will be truncated if needed.*/maxQuestionLen?: number;/*** The maximum length of the total sentence (context + question) in tokens of each chunk* passed to the model. The context will be split in several chunks (using doc_stride as* overlap) if needed.*/maxSeqLen?: number;/*** The number of answers to return (will be chosen by order of likelihood). Can return less* than top_k answers if there are not enough options available within the context.*/topK?: number;/*** A list of words and bounding boxes (normalized 0->1000). If provided, the inference will* skip the OCR step and use the provided bounding boxes instead.*/wordBoxes?: WordBox[];[property: string]: unknown;}export type WordBox = number[] | string;6 unmodified lines* The answer to the question.*/answer: string;end: number;/*** The probability associated to the answer.*/score: number;start: number;/*** The index of each word/box pair that is in the answer41 unmodified lines42434445464748495051522 unmodified lines5556575859606162636465666768697071727374757677787980816 unmodified lines88899091929394959697989910010110210310410510641 unmodified lines* be split in several chunks with some overlap. This argument controls the size of that* overlap.*/doc_stride?: number;/*** Whether to accept impossible as an answer*/handle_impossible_answer?: boolean;/*** Language to use while running OCR. Defaults to english.*/2 unmodified lines* The maximum length of predicted answers (e.g., only answers with a shorter length are* considered).*/max_answer_len?: number;/*** The maximum length of the question after tokenization. It will be truncated if needed.*/max_question_len?: number;/*** The maximum length of the total sentence (context + question) in tokens of each chunk* passed to the model. The context will be split in several chunks (using doc_stride as* overlap) if needed.*/max_seq_len?: number;/*** The number of answers to return (will be chosen by order of likelihood). Can return less* than top_k answers if there are not enough options available within the context.*/top_k?: number;/*** A list of words and bounding boxes (normalized 0->1000). If provided, the inference will* skip the OCR step and use the provided bounding boxes instead.*/word_boxes?: WordBox[];[property: string]: unknown;}export type WordBox = number[] | string;6 unmodified lines* The answer to the question.*/answer: string;/*** The end word index of the answer (in the OCR’d version of the input or provided word* boxes).*/end: number;/*** The probability associated to the answer.*/score: number;/*** The start word index of the answer (in the OCR’d version of the input or provided word* boxes).*/start: number;/*** The index of each word/box pair that is in the answer
30 unmodified lines31323334353637383940411 unmodified line434445464748495051525354555657585960616263646530 unmodified lines"description": "Additional inference parameters for Document Question Answering","type": "object","properties": {"docStride": {"type": "integer","description": "If the words in the document are too long to fit with the question for the model, it will be split in several chunks with some overlap. This argument controls the size of that overlap."},"handleImpossibleAnswer": {"type": "boolean","description": "Whether to accept impossible as an answer"},1 unmodified line"type": "string","description": "Language to use while running OCR. Defaults to english."},"maxAnswerLen": {"type": "integer","description": "The maximum length of predicted answers (e.g., only answers with a shorter length are considered)."},"maxSeqLen": {"type": "integer","description": "The maximum length of the total sentence (context + question) in tokens of each chunk passed to the model. The context will be split in several chunks (using doc_stride as overlap) if needed."},"maxQuestionLen": {"type": "integer","description": "The maximum length of the question after tokenization. It will be truncated if needed."},"topK": {"type": "integer","description": "The number of answers to return (will be chosen by order of likelihood). Can return less than top_k answers if there are not enough options available within the context."},"wordBoxes": {"type": "array","description": "A list of words and bounding boxes (normalized 0->1000). If provided, the inference will skip the OCR step and use the provided bounding boxes instead.","items": {30 unmodified lines31323334353637383940411 unmodified line434445464748495051525354555657585960616263646530 unmodified lines"description": "Additional inference parameters for Document Question Answering","type": "object","properties": {"doc_stride": {"type": "integer","description": "If the words in the document are too long to fit with the question for the model, it will be split in several chunks with some overlap. This argument controls the size of that overlap."},"handle_impossible_answer": {"type": "boolean","description": "Whether to accept impossible as an answer"},1 unmodified line"type": "string","description": "Language to use while running OCR. Defaults to english."},"max_answer_len": {"type": "integer","description": "The maximum length of predicted answers (e.g., only answers with a shorter length are considered)."},"max_seq_len": {"type": "integer","description": "The maximum length of the total sentence (context + question) in tokens of each chunk passed to the model. The context will be split in several chunks (using doc_stride as overlap) if needed."},"max_question_len": {"type": "integer","description": "The maximum length of the question after tokenization. It will be truncated if needed."},"top_k": {"type": "integer","description": "The number of answers to return (will be chosen by order of likelihood). Can return less than top_k answers if there are not enough options available within the context."},"word_boxes": {"type": "array","description": "A list of words and bounding boxes (normalized 0->1000). If provided, the inference will skip the OCR step and use the provided bounding boxes instead.","items": {
16 unmodified lines171819202122232425262716 unmodified lines},"start": {"type": "integer","descrtiption": "The start word index of the answer (in the OCR’d version of the input or provided word boxes)."},"end": {"type": "integer","descrtiption": "The end word index of the answer (in the OCR’d version of the input or provided word boxes)."},"words": {"type": "array",16 unmodified lines171819202122232425262716 unmodified lines},"start": {"type": "integer","description": "The start word index of the answer (in the OCR\u2019d version of the input or provided word boxes)."},"end": {"type": "integer","description": "The end word index of the answer (in the OCR\u2019d version of the input or provided word boxes)."},"words": {"type": "array",
32 unmodified lines3334353637383913 unmodified lines53545556575859606132 unmodified lines/*** When passed, overrides the number of predictions to return.*/topK?: number;[property: string]: unknown;}export type FillMaskOutput = FillMaskOutputElement[];13 unmodified lines* The predicted token id (to replace the masked one).*/token: number;/*** The predicted token (to replace the masked one).*/tokenStr: string;[property: string]: unknown;}32 unmodified lines3334353637383913 unmodified lines5354555657585960616232 unmodified lines/*** When passed, overrides the number of predictions to return.*/top_k?: number;[property: string]: unknown;}export type FillMaskOutput = FillMaskOutputElement[];13 unmodified lines* The predicted token id (to replace the masked one).*/token: number;tokenStr: unknown;/*** The predicted token (to replace the masked one).*/token_str?: string;[property: string]: unknown;}
19 unmodified lines2021222324252619 unmodified lines"description": "Additional inference parameters for Fill Mask","type": "object","properties": {"topK": {"type": "integer","description": "When passed, overrides the number of predictions to return."},19 unmodified lines2021222324252619 unmodified lines"description": "Additional inference parameters for Fill Mask","type": "object","properties": {"top_k": {"type": "integer","description": "When passed, overrides the number of predictions to return."},
18 unmodified lines1920212223242518 unmodified lines"type": "integer","description": "The predicted token id (to replace the masked one)."},"tokenStr": {"type": "string","description": "The predicted token (to replace the masked one)."}18 unmodified lines1920212223242518 unmodified lines"type": "integer","description": "The predicted token id (to replace the masked one)."},"token_str": {"type": "string","description": "The predicted token (to replace the masked one)."}
22 unmodified lines232425262728293031323322 unmodified lines* Additional inference parameters for Image Classification*/export interface ImageClassificationParameters {functionToApply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/topK?: number;[property: string]: unknown;}/**22 unmodified lines232425262728293031323322 unmodified lines* Additional inference parameters for Image Classification*/export interface ImageClassificationParameters {function_to_apply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/top_k?: number;[property: string]: unknown;}/**
18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Image Classification","type": "object","properties": {"functionToApply": {"title": "ImageClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"topK": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Image Classification","type": "object","properties": {"function_to_apply": {"title": "ImageClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"top_k": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}
25 unmodified lines262728293031323334353625 unmodified lines/*** Threshold to use when turning the predicted masks into binary values.*/maskThreshold?: number;/*** Mask overlap threshold to eliminate small, disconnected segments.*/overlapMaskAreaThreshold?: number;/*** Segmentation task to be performed, depending on model capabilities.*/25 unmodified lines262728293031323334353625 unmodified lines/*** Threshold to use when turning the predicted masks into binary values.*/mask_threshold?: number;/*** Mask overlap threshold to eliminate small, disconnected segments.*/overlap_mask_area_threshold?: number;/*** Segmentation task to be performed, depending on model capabilities.*/
18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Image Segmentation","type": "object","properties": {"maskThreshold": {"type": "number","description": "Threshold to use when turning the predicted masks into binary values."},"overlapMaskAreaThreshold": {"type": "number","description": "Mask overlap threshold to eliminate small, disconnected segments."},18 unmodified lines192021222324252627282918 unmodified lines"description": "Additional inference parameters for Image Segmentation","type": "object","properties": {"mask_threshold": {"type": "number","description": "Threshold to use when turning the predicted masks into binary values."},"overlap_mask_area_threshold": {"type": "number","description": "Mask overlap threshold to eliminate small, disconnected segments."},
28 unmodified lines293031323334353637383940414243444546474828 unmodified lines* For diffusion models. A higher guidance scale value encourages the model to generate* images closely linked to the text prompt at the expense of lower image quality.*/guidanceScale?: number;/*** One or several prompt to guide what NOT to include in image generation.*/negativePrompt?: string[];/*** For diffusion models. The number of denoising steps. More denoising steps usually lead to* a higher quality image at the expense of slower inference.*/numInferenceSteps?: number;/*** The size in pixel of the output image*/targetSize?: TargetSize;[property: string]: unknown;}28 unmodified lines293031323334353637383940414243444546474828 unmodified lines* For diffusion models. A higher guidance scale value encourages the model to generate* images closely linked to the text prompt at the expense of lower image quality.*/guidance_scale?: number;/*** One or several prompt to guide what NOT to include in image generation.*/negative_prompt?: string[];/*** For diffusion models. The number of denoising steps. More denoising steps usually lead to* a higher quality image at the expense of slower inference.*/num_inference_steps?: number;/*** The size in pixel of the output image*/target_size?: TargetSize;[property: string]: unknown;}
18 unmodified lines1920212223242526272829303132333435363738394018 unmodified lines"description": "Additional inference parameters for Image To Image","type": "object","properties": {"guidanceScale": {"type": "number","description": "For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality."},"negativePrompt": {"type": "array","items": {"type": "string"},"description": "One or several prompt to guide what NOT to include in image generation."},"numInferenceSteps": {"type": "integer","description": "For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."},"targetSize": {"type": "object","description": "The size in pixel of the output image","properties": {18 unmodified lines1920212223242526272829303132333435363738394018 unmodified lines"description": "Additional inference parameters for Image To Image","type": "object","properties": {"guidance_scale": {"type": "number","description": "For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality."},"negative_prompt": {"type": "array","items": {"type": "string"},"description": "One or several prompt to guide what NOT to include in image generation."},"num_inference_steps": {"type": "integer","description": "For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."},"target_size": {"type": "object","description": "The size in pixel of the output image","properties": {
2 unmodified lines3456788 unmodified lines1718192021227 unmodified lines3031323334353637383 unmodified lines4243444546474849505152535455565758593 unmodified lines636465666768697071727374757677787980818283848586878889909192939495969798991 unmodified line1011021031041051061071081091101111121 unmodified line1141151161171181191201211221231241251261271281291301311321331341351361371382 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Image To Text inference*/8 unmodified linesparameters?: ImageToTextParameters;[property: string]: unknown;}/*** Additional inference parameters*7 unmodified lines/*** The amount of maximum tokens to generate.*/maxNewTokens?: number;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/doSample?: boolean;/*** Controls the stopping condition for beam-based methods.*/earlyStopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilonCutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/etaCutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/maxLength?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/maxNewTokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/minLength?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/minNewTokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/numBeamGroups?: number;/*** Number of beams to use for beam search.*/numBeams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penaltyAlpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/topK?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/topP?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typicalP?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/useCache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";export type ImageToTextOutput = ImageToTextOutputElement[];/*** Outputs of inference for the Image To Text task*/export interface ImageToTextOutputElement {/*** The generated text.*/generatedText: string;[property: string]: unknown;}2 unmodified lines34567898 unmodified lines181920212223247 unmodified lines323334353637383940413 unmodified lines4546474849505152535455565758596061623 unmodified lines666768697071727374757677787980818283848586878889909192939495969798991001011021 unmodified line1041051061071081091101111121131141151 unmodified line1171181191201211221231241251261271281291301311321331341351361371381391401411421432 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Image To Text inference*/8 unmodified linesparameters?: ImageToTextParameters;[property: string]: unknown;}/*** Additional inference parameters*7 unmodified lines/*** The amount of maximum tokens to generate.*/max_new_tokens?: number;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/do_sample?: boolean;/*** Controls the stopping condition for beam-based methods.*/early_stopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilon_cutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/eta_cutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/max_length?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/max_new_tokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/min_length?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/min_new_tokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/num_beam_groups?: number;/*** Number of beams to use for beam search.*/num_beams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penalty_alpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/top_k?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/top_p?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typical_p?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/use_cache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";/*** Outputs of inference for the Image To Text task*/export interface ImageToTextOutput {generatedText: unknown;/*** The generated text.*/generated_text?: string;[property: string]: unknown;}
18 unmodified lines1920212223242518 unmodified lines"description": "Additional inference parameters for Image To Text","type": "object","properties": {"maxNewTokens": {"type": "integer","description": "The amount of maximum tokens to generate."},18 unmodified lines1920212223242518 unmodified lines"description": "Additional inference parameters for Image To Text","type": "object","properties": {"max_new_tokens": {"type": "integer","description": "The amount of maximum tokens to generate."},
2 unmodified lines345678910111213141516172 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Image To Text task","title": "ImageToTextOutput","type": "array","items": {"type": "object","properties": {"generatedText": {"type": "string","description": "The generated text."}},"required": ["generatedText"]}}2 unmodified lines345678910111213142 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Image To Text task","title": "ImageToTextOutput","type": "object","properties": {"generated_text": {"type": "string","description": "The generated text."}},"required": ["generatedText"]}
19 unmodified lines202122232425262728293019 unmodified lines"description": "TODO: describe additional parameters here.","type": "object","properties": {"dummyParameterName": {"type": "boolean","description": "TODO: describe the parameter here"},"dummyParameterName2": {"type": "integer","description": "TODO: describe the parameter here"}19 unmodified lines202122232425262728293019 unmodified lines"description": "TODO: describe additional parameters here.","type": "object","properties": {"dummy_parameter_name": {"type": "boolean","description": "TODO: describe the parameter here"},"dummy_parameter_name2": {"type": "integer","description": "TODO: describe the parameter here"}
6 unmodified lines789101112136 unmodified lines"items": {"type": "object","properties": {"meaningfulOutputName": {"type": "string","description": "TODO: Describe what is outputed by the inference here"}6 unmodified lines789101112136 unmodified lines"items": {"type": "object","properties": {"meaningful_output_name": {"type": "string","description": "TODO: Describe what is outputed by the inference here"}
40 unmodified lines4142434445464748495051525354555657585960616263646566676869707172737475767740 unmodified lines* Attempts to align the answer to real words. Improves quality on space separated* languages. Might hurt on non-space-separated languages (like Japanese or Chinese)*/alignToWords?: boolean;/*** If the context is too long to fit with the question for the model, it will be split in* several chunks with some overlap. This argument controls the size of that overlap.*/docStride?: number;/*** Whether to accept impossible as an answer.*/handleImpossibleAnswer?: boolean;/*** The maximum length of predicted answers (e.g., only answers with a shorter length are* considered).*/maxAnswerLen?: number;/*** The maximum length of the question after tokenization. It will be truncated if needed.*/maxQuestionLen?: number;/*** The maximum length of the total sentence (context + question) in tokens of each chunk* passed to the model. The context will be split in several chunks (using docStride as* overlap) if needed.*/maxSeqLen?: number;/*** The number of answers to return (will be chosen by order of likelihood). Note that we* return less than topk answers if there are not enough options available within the* context.*/topK?: number;[property: string]: unknown;}export type QuestionAnsweringOutput = QuestionAnsweringOutputElement[];40 unmodified lines4142434445464748495051525354555657585960616263646566676869707172737475767740 unmodified lines* Attempts to align the answer to real words. Improves quality on space separated* languages. Might hurt on non-space-separated languages (like Japanese or Chinese)*/align_to_words?: boolean;/*** If the context is too long to fit with the question for the model, it will be split in* several chunks with some overlap. This argument controls the size of that overlap.*/doc_stride?: number;/*** Whether to accept impossible as an answer.*/handle_impossible_answer?: boolean;/*** The maximum length of predicted answers (e.g., only answers with a shorter length are* considered).*/max_answer_len?: number;/*** The maximum length of the question after tokenization. It will be truncated if needed.*/max_question_len?: number;/*** The maximum length of the total sentence (context + question) in tokens of each chunk* passed to the model. The context will be split in several chunks (using docStride as* overlap) if needed.*/max_seq_len?: number;/*** The number of answers to return (will be chosen by order of likelihood). Note that we* return less than topk answers if there are not enough options available within the* context.*/top_k?: number;[property: string]: unknown;}export type QuestionAnsweringOutput = QuestionAnsweringOutputElement[];
31 unmodified lines3233343536373839404142434445464748495051525354555657585960616231 unmodified lines"description": "Additional inference parameters for Question Answering","type": "object","properties": {"topK": {"type": "integer","description": "The number of answers to return (will be chosen by order of likelihood). Note that we return less than topk answers if there are not enough options available within the context."},"docStride": {"type": "integer","description": "If the context is too long to fit with the question for the model, it will be split in several chunks with some overlap. This argument controls the size of that overlap."},"maxAnswerLen": {"type": "integer","description": "The maximum length of predicted answers (e.g., only answers with a shorter length are considered)."},"maxSeqLen": {"type": "integer","description": "The maximum length of the total sentence (context + question) in tokens of each chunk passed to the model. The context will be split in several chunks (using docStride as overlap) if needed."},"maxQuestionLen": {"type": "integer","description": "The maximum length of the question after tokenization. It will be truncated if needed."},"handleImpossibleAnswer": {"type": "boolean","description": "Whether to accept impossible as an answer."},"alignToWords": {"type": "boolean","description": "Attempts to align the answer to real words. Improves quality on space separated languages. Might hurt on non-space-separated languages (like Japanese or Chinese)"}31 unmodified lines3233343536373839404142434445464748495051525354555657585960616231 unmodified lines"description": "Additional inference parameters for Question Answering","type": "object","properties": {"top_k": {"type": "integer","description": "The number of answers to return (will be chosen by order of likelihood). Note that we return less than topk answers if there are not enough options available within the context."},"doc_stride": {"type": "integer","description": "If the context is too long to fit with the question for the model, it will be split in several chunks with some overlap. This argument controls the size of that overlap."},"max_answer_len": {"type": "integer","description": "The maximum length of predicted answers (e.g., only answers with a shorter length are considered)."},"max_seq_len": {"type": "integer","description": "The maximum length of the total sentence (context + question) in tokens of each chunk passed to the model. The context will be split in several chunks (using docStride as overlap) if needed."},"max_question_len": {"type": "integer","description": "The maximum length of the question after tokenization. It will be truncated if needed."},"handle_impossible_answer": {"type": "boolean","description": "Whether to accept impossible as an answer."},"align_to_words": {"type": "boolean","description": "Attempts to align the answer to real words. Improves quality on space separated languages. Might hurt on non-space-separated languages (like Japanese or Chinese)"}
29 unmodified lines30313233343536373839409 unmodified lines50515253545556575829 unmodified lines/*** Whether to clean up the potential extra spaces in the text output.*/cleanUpTokenizationSpaces?: boolean;/*** Additional parametrization of the text generation algorithm*/generateParameters?: { [key: string]: unknown };/*** The truncation strategy to use*/9 unmodified lines* Outputs of inference for the Text2text Generation task*/export interface SummarizationOutput {/*** The generated text.*/generatedText: string;[property: string]: unknown;}29 unmodified lines30313233343536373839409 unmodified lines5051525354555657585929 unmodified lines/*** 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?: { [key: string]: unknown };/*** The truncation strategy to use*/9 unmodified lines* Outputs of inference for the Text2text Generation task*/export interface SummarizationOutput {generatedText: unknown;/*** The generated text.*/generated_text?: string;[property: string]: unknown;}
22 unmodified lines232425262728293031323322 unmodified lines* Additional inference parameters for Text Classification*/export interface TextClassificationParameters {functionToApply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/topK?: number;[property: string]: unknown;}/**22 unmodified lines232425262728293031323322 unmodified lines* Additional inference parameters for Text Classification*/export interface TextClassificationParameters {function_to_apply?: ClassificationOutputTransform;/*** When specified, limits the output to the top K most probable classes.*/top_k?: number;[property: string]: unknown;}/**
19 unmodified lines202122232425262728293019 unmodified lines"description": "Additional inference parameters for Text Classification","type": "object","properties": {"functionToApply": {"title": "TextClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"topK": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}19 unmodified lines202122232425262728293019 unmodified lines"description": "Additional inference parameters for Text Classification","type": "object","properties": {"function_to_apply": {"title": "TextClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"top_k": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}
2 unmodified lines3456788 unmodified lines1718192021223 unmodified lines2627282930313233343536373839404142434445464748491 unmodified line5152535455565758596061622 unmodified lines6566676869707172737475767778798081828384852 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text Generation inference*/8 unmodified linesparameters?: TextGenerationParameters;[property: string]: unknown;}/*** Additional inference parameters*3 unmodified lines/*** Whether to use logit sampling (true) or greedy search (false).*/doSample?: boolean;/*** Maximum number of generated tokens.*/maxNewTokens?: number;/*** The parameter for repetition penalty. A value of 1.0 means no penalty. See [this* paper](https://hf.co/papers/1909.05858) for more details.*/repetitionPenalty?: number;/*** Whether to prepend the prompt to the generated text.*/returnFullText?: boolean;/*** Stop generating tokens if a member of `stop_sequences` is generated.*/stopSequences?: string[];/*** The value used to modulate the logits distribution.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/topK?: number;/*** If set to < 1, only the smallest set of most probable tokens with probabilities that add* up to `top_p` or higher are kept for generation.*/topP?: number;/*** Truncate input tokens to the given size.*/2 unmodified lines* Typical Decoding mass. See [Typical Decoding for Natural Language* Generation](https://hf.co/papers/2202.00666) for more information*/typicalP?: number;/*** Watermarking with [A Watermark for Large Language Models](https://hf.co/papers/2301.10226)*/watermark?: boolean;[property: string]: unknown;}export type TextGenerationOutput = TextGenerationOutputElement[];/*** Outputs for Text Generation inference*/export interface TextGenerationOutputElement {/*** The generated text*/generatedText: string;[property: string]: unknown;}2 unmodified lines34567898 unmodified lines181920212223243 unmodified lines2829303132333435363738394041424344454647484950511 unmodified line5354555657585960616263642 unmodified lines676869707172737475767778798081828384858687882 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text Generation inference*/8 unmodified linesparameters?: TextGenerationParameters;[property: string]: unknown;}/*** Additional inference parameters*3 unmodified lines/*** Whether to use logit sampling (true) or greedy search (false).*/do_sample?: boolean;/*** Maximum number of generated tokens.*/max_new_tokens?: number;/*** The parameter for repetition penalty. A value of 1.0 means no penalty. See [this* paper](https://hf.co/papers/1909.05858) for more details.*/repetition_penalty?: number;/*** Whether to prepend the prompt to the generated text.*/return_full_text?: boolean;/*** Stop generating tokens if a member of `stop_sequences` is generated.*/stop_sequences?: string[];/*** The value used to modulate the logits distribution.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/top_k?: number;/*** If set to < 1, only the smallest set of most probable tokens with probabilities that add* up to `top_p` or higher are kept for generation.*/top_p?: number;/*** Truncate input tokens to the given size.*/2 unmodified lines* Typical Decoding mass. See [Typical Decoding for Natural Language* Generation](https://hf.co/papers/2202.00666) for more information*/typical_p?: number;/*** Watermarking with [A Watermark for Large Language Models](https://hf.co/papers/2301.10226)*/watermark?: boolean;[property: string]: unknown;}/*** Outputs for Text Generation inference*/export interface TextGenerationOutput {generatedText: unknown;/*** The generated text*/generated_text?: string;[property: string]: unknown;}
19 unmodified lines20212223242526272829303132333435363738394041424 unmodified lines47484950515253545556571 unmodified line5960616263646519 unmodified lines"description": "Additional inference parameters for Text Generation","type": "object","properties": {"doSample": {"type": "boolean","description": "Whether to use logit sampling (true) or greedy search (false)."},"maxNewTokens": {"type": "integer","description": "Maximum number of generated tokens."},"repetitionPenalty": {"type": "number","description": "The parameter for repetition penalty. A value of 1.0 means no penalty. See [this paper](https://hf.co/papers/1909.05858) for more details."},"returnFullText": {"type": "boolean","description": "Whether to prepend the prompt to the generated text."},"stopSequences": {"type": "array","items": {"type": "string"4 unmodified lines"type": "number","description": "The value used to modulate the logits distribution."},"topK": {"type": "integer","description": "The number of highest probability vocabulary tokens to keep for top-k-filtering."},"topP": {"type": "number","description": "If set to < 1, only the smallest set of most probable tokens with probabilities that add up to `top_p` or higher are kept for generation."},1 unmodified line"type": "integer","description": "Truncate input tokens to the given size."},"typicalP": {"type": "number","description": "Typical Decoding mass. See [Typical Decoding for Natural Language Generation](https://hf.co/papers/2202.00666) for more information"},19 unmodified lines20212223242526272829303132333435363738394041424 unmodified lines47484950515253545556571 unmodified line5960616263646519 unmodified lines"description": "Additional inference parameters for Text Generation","type": "object","properties": {"do_sample": {"type": "boolean","description": "Whether to use logit sampling (true) or greedy search (false)."},"max_new_tokens": {"type": "integer","description": "Maximum number of generated tokens."},"repetition_penalty": {"type": "number","description": "The parameter for repetition penalty. A value of 1.0 means no penalty. See [this paper](https://hf.co/papers/1909.05858) for more details."},"return_full_text": {"type": "boolean","description": "Whether to prepend the prompt to the generated text."},"stop_sequences": {"type": "array","items": {"type": "string"4 unmodified lines"type": "number","description": "The value used to modulate the logits distribution."},"top_k": {"type": "integer","description": "The number of highest probability vocabulary tokens to keep for top-k-filtering."},"top_p": {"type": "number","description": "If set to < 1, only the smallest set of most probable tokens with probabilities that add up to `top_p` or higher are kept for generation."},1 unmodified line"type": "integer","description": "Truncate input tokens to the given size."},"typical_p": {"type": "number","description": "Typical Decoding mass. See [Typical Decoding for Natural Language Generation](https://hf.co/papers/2202.00666) for more information"},
2 unmodified lines345678910111213141516172 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs for Text Generation inference","title": "TextGenerationOutput","type": "array","items": {"type": "object","properties": {"generatedText": {"type": "string","description": "The generated text"}},"required": ["generatedText"]}}2 unmodified lines345678910111213142 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs for Text Generation inference","title": "TextGenerationOutput","type": "object","properties": {"generated_text": {"type": "string","description": "The generated text"}},"required": ["generatedText"]}
2 unmodified lines3456788 unmodified lines1718192021226 unmodified lines2930313233343 unmodified lines3839404142434445464748495051525354553 unmodified lines596061626364656667686970717273747576777879808182838485868788899091929394951 unmodified line9798991001011021031041051061071081 unmodified line1101111121131141151161171181191201211221231241251261271281291301311321331341351361371382 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text To Audio inference*/8 unmodified linesparameters?: TextToAudioParameters;[property: string]: unknown;}/*** Additional inference parameters*6 unmodified linesgenerate?: GenerationParameters;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/doSample?: boolean;/*** Controls the stopping condition for beam-based methods.*/earlyStopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilonCutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/etaCutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/maxLength?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/maxNewTokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/minLength?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/minNewTokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/numBeamGroups?: number;/*** Number of beams to use for beam search.*/numBeams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penaltyAlpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/topK?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/topP?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typicalP?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/useCache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";export type TextToAudioOutput = TextToAudioOutputElement[];/*** Outputs of inference for the Text To Audio task*/export interface TextToAudioOutputElement {/*** The generated audio waveform.*/audio: unknown;/*** The sampling rate of the generated audio waveform.*/samplingRate: number;[property: string]: unknown;}2 unmodified lines34567898 unmodified lines181920212223246 unmodified lines313233343536373 unmodified lines4142434445464748495051525354555657583 unmodified lines626364656667686970717273747576777879808182838485868788899091929394959697981 unmodified line1001011021031041051061071081091101111 unmodified line1131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421432 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text To Audio inference*/8 unmodified linesparameters?: TextToAudioParameters;[property: string]: unknown;}/*** Additional inference parameters*6 unmodified linesgenerate?: GenerationParameters;[property: string]: unknown;}/*** Parametrization of the text generation process*3 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/do_sample?: boolean;/*** Controls the stopping condition for beam-based methods.*/early_stopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilon_cutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/eta_cutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/max_length?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/max_new_tokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/min_length?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/min_new_tokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/num_beam_groups?: number;/*** Number of beams to use for beam search.*/num_beams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penalty_alpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/top_k?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/top_p?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typical_p?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/use_cache?: boolean;[property: string]: unknown;}/*** Controls the stopping condition for beam-based methods.*/export type EarlyStoppingUnion = boolean | "never";/*** Outputs of inference for the Text To Audio task*/export interface TextToAudioOutput {/*** The generated audio waveform.*/audio: unknown;samplingRate: unknown;/*** The sampling rate of the generated audio waveform.*/sampling_rate?: number;[property: string]: unknown;}
2 unmodified lines345678910111213141516171819202 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text To Audio task","title": "TextToAudioOutput","type": "array","items": {"type": "object","properties": {"audio": {"description": "The generated audio waveform."},"samplingRate": {"type": "number","description": "The sampling rate of the generated audio waveform."}},"required": ["audio", "samplingRate"]}}2 unmodified lines345678910111213141516172 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text To Audio task","title": "TextToAudioOutput","type": "object","properties": {"audio": {"description": "The generated audio waveform."},"sampling_rate": {"type": "number","description": "The sampling rate of the generated audio waveform."}},"required": ["audio", "samplingRate"]}
28 unmodified lines293031323334353637383940414243441 unmodified line464748495051529 unmodified lines62636465666768697028 unmodified lines* For diffusion models. A higher guidance scale value encourages the model to generate* images closely linked to the text prompt at the expense of lower image quality.*/guidanceScale?: number;/*** One or several prompt to guide what NOT to include in image generation.*/negativePrompt?: string[];/*** For diffusion models. The number of denoising steps. More denoising steps usually lead to* a higher quality image at the expense of slower inference.*/numInferenceSteps?: number;/*** For diffusion models. Override the scheduler with a compatible one*/1 unmodified line/*** The size in pixel of the output image*/targetSize?: TargetSize;[property: string]: unknown;}9 unmodified lines/*** Outputs of inference for the Text To Image task*/export type TextToImageOutput = unknown[] | boolean | number | number | null | TextToImageOutputObject | string;export interface TextToImageOutputObject {/*** The generated image*/28 unmodified lines293031323334353637383940414243441 unmodified line464748495051529 unmodified lines6263646566676828 unmodified lines* For diffusion models. A higher guidance scale value encourages the model to generate* images closely linked to the text prompt at the expense of lower image quality.*/guidance_scale?: number;/*** One or several prompt to guide what NOT to include in image generation.*/negative_prompt?: string[];/*** For diffusion models. The number of denoising steps. More denoising steps usually lead to* a higher quality image at the expense of slower inference.*/num_inference_steps?: number;/*** For diffusion models. Override the scheduler with a compatible one*/1 unmodified line/*** The size in pixel of the output image*/target_size?: TargetSize;[property: string]: unknown;}9 unmodified lines/*** Outputs of inference for the Text To Image task*/export interface TextToImageOutput {/*** The generated image*/
19 unmodified lines2021222324252627282930313233343536373839404119 unmodified lines"description": "Additional inference parameters for Text To Image","type": "object","properties": {"guidanceScale": {"type": "number","description": "For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality."},"negativePrompt": {"type": "array","items": {"type": "string"},"description": "One or several prompt to guide what NOT to include in image generation."},"numInferenceSteps": {"type": "integer","description": "For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."},"targetSize": {"type": "object","description": "The size in pixel of the output image","properties": {19 unmodified lines2021222324252627282930313233343536373839404119 unmodified lines"description": "Additional inference parameters for Text To Image","type": "object","properties": {"guidance_scale": {"type": "number","description": "For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality."},"negative_prompt": {"type": "array","items": {"type": "string"},"description": "One or several prompt to guide what NOT to include in image generation."},"num_inference_steps": {"type": "integer","description": "For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."},"target_size": {"type": "object","description": "The size in pixel of the output image","properties": {
2 unmodified lines34567891011121314152 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text To Image task","title": "TextToImageOutput","type": "array","items": {"properties": {"image": {"description": "The generated image"}},"required": ["image"]}}2 unmodified lines3456789101112132 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text To Image task","title": "TextToImageOutput","type": "object","properties": {"image": {"description": "The generated image"}},"required": ["image"]}
42 unmodified lines4344454647484950515253545556575859603 unmodified lines6465666768697071727374757677787980818283848586878889909192939495969798991001 unmodified line1021031041051061071081091101111121131 unmodified line11511611711811912012112212312412512 unmodified lines13813914014114214314414514642 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/doSample?: boolean;/*** Controls the stopping condition for beam-based methods.*/earlyStopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilonCutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/etaCutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/maxLength?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/maxNewTokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/minLength?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/minNewTokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/numBeamGroups?: number;/*** Number of beams to use for beam search.*/numBeams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penaltyAlpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/topK?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/topP?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typicalP?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/useCache?: boolean;[property: string]: unknown;}12 unmodified lines* The generated audio waveform.*/audio: unknown;/*** The sampling rate of the generated audio waveform.*/samplingRate: number;[property: string]: unknown;}42 unmodified lines4344454647484950515253545556575859603 unmodified lines6465666768697071727374757677787980818283848586878889909192939495969798991001 unmodified line1021031041051061071081091101111121131 unmodified line11511611711811912012112212312412512 unmodified lines13813914014114214314414514614742 unmodified lines/*** Whether to use sampling instead of greedy decoding when generating new tokens.*/do_sample?: boolean;/*** Controls the stopping condition for beam-based methods.*/early_stopping?: EarlyStoppingUnion;/*** If set to float strictly between 0 and 1, only tokens with a conditional probability* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.*/epsilon_cutoff?: number;/*** Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to* float strictly between 0 and 1, a token is only considered if it is greater than either3 unmodified lines* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)* for more details.*/eta_cutoff?: number;/*** The maximum length (in tokens) of the generated text, including the input.*/max_length?: number;/*** The maximum number of tokens to generate. Takes precedence over maxLength.*/max_new_tokens?: number;/*** The minimum length (in tokens) of the generated text, including the input.*/min_length?: number;/*** The minimum number of tokens to generate. Takes precedence over maxLength.*/min_new_tokens?: number;/*** Number of groups to divide num_beams into in order to ensure diversity among different* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.*/num_beam_groups?: number;/*** Number of beams to use for beam search.*/num_beams?: number;/*** The value balances the model confidence and the degeneration penalty in contrastive* search decoding.*/penalty_alpha?: number;/*** The value used to modulate the next token probabilities.*/1 unmodified line/*** The number of highest probability vocabulary tokens to keep for top-k-filtering.*/top_k?: number;/*** If set to float < 1, only the smallest set of most probable tokens with probabilities* that add up to top_p or higher are kept for generation.*/top_p?: number;/*** Local typicality measures how similar the conditional probability of predicting a target* token next is to the expected conditional probability of predicting a random token next,1 unmodified line* most locally typical tokens with probabilities that add up to typical_p or higher are* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.*/typical_p?: number;/*** Whether the model should use the past last key/values attentions to speed up decoding*/use_cache?: boolean;[property: string]: unknown;}12 unmodified lines* The generated audio waveform.*/audio: unknown;samplingRate: unknown;/*** The sampling rate of the generated audio waveform.*/sampling_rate?: number;[property: string]: unknown;}
2 unmodified lines3456788 unmodified lines1718192021223 unmodified lines262728293031323334353637383940414243444546474849505152532 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text2text Generation inference*/8 unmodified linesparameters?: Text2TextGenerationParameters;[property: string]: unknown;}/*** Additional inference parameters*3 unmodified lines/*** Whether to clean up the potential extra spaces in the text output.*/cleanUpTokenizationSpaces?: boolean;/*** Additional parametrization of the text generation algorithm*/generateParameters?: {[key: string]: unknown;};/*** The truncation strategy to use*/truncation?: Text2TextGenerationTruncationStrategy;[property: string]: unknown;}export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";export type Text2TextGenerationOutput = Text2TextGenerationOutputElement[];/*** Outputs of inference for the Text2text Generation task*/export interface Text2TextGenerationOutputElement {/*** The generated text.*/generatedText: string;[property: string]: unknown;}2 unmodified lines34567898 unmodified lines181920212223243 unmodified lines282930313233343536373839404142434445464748495051525354552 unmodified lines** Using src/scripts/inference-codegen*//*** Inputs for Text2text Generation inference*/8 unmodified linesparameters?: Text2TextGenerationParameters;[property: string]: unknown;}/*** Additional inference parameters*3 unmodified lines/*** 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?: { [key: string]: unknown };/*** The truncation strategy to use*/truncation?: Text2TextGenerationTruncationStrategy;[property: string]: unknown;}export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";/*** Outputs of inference for the Text2text Generation task*/export interface Text2TextGenerationOutput {generatedText: unknown;/*** The generated text.*/generated_text?: string;[property: string]: unknown;}
19 unmodified lines2021222324252616 unmodified lines4344454647484919 unmodified lines"description": "Additional inference parameters for Text2text Generation","type": "object","properties": {"cleanUpTokenizationSpaces": {"type": "boolean","description": "Whether to clean up the potential extra spaces in the text output."},16 unmodified lines}]},"generateParameters": {"title": "generateParameters","type": "object","description": "Additional parametrization of the text generation algorithm"19 unmodified lines2021222324252616 unmodified lines4344454647484919 unmodified lines"description": "Additional inference parameters for Text2text Generation","type": "object","properties": {"clean_up_tokenization_spaces": {"type": "boolean","description": "Whether to clean up the potential extra spaces in the text output."},16 unmodified lines}]},"generate_parameters": {"title": "generateParameters","type": "object","description": "Additional parametrization of the text generation algorithm"
2 unmodified lines345678910111213141516172 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text2text Generation task","title": "Text2TextGenerationOutput","type": "array","items": {"type": "object","properties": {"generatedText": {"type": "string","description": "The generated text."}},"required": ["generatedText"]}}2 unmodified lines345678910111213142 unmodified lines"$schema": "http://json-schema.org/draft-06/schema#","description": "Outputs of inference for the Text2text Generation task","title": "Text2TextGenerationOutput","type": "object","properties": {"generated_text": {"type": "string","description": "The generated text."}},"required": ["generatedText"]}
25 unmodified lines262728293031323334353627 unmodified lines6465666768697025 unmodified lines/*** The strategy used to fuse tokens based on model predictions*/aggregationStrategy?: TokenClassificationAggregationStrategy;/*** A list of labels to ignore*/ignoreLabels?: string[];/*** The number of overlapping tokens between chunks when splitting the input text.*/27 unmodified lines/*** The predicted label for that group of tokens*/entityGroup?: string;label: unknown;/*** The associated score / probability25 unmodified lines262728293031323334353627 unmodified lines6465666768697025 unmodified lines/*** The strategy used to fuse tokens based on model predictions*/aggregation_strategy?: TokenClassificationAggregationStrategy;/*** A list of labels to ignore*/ignore_labels?: string[];/*** The number of overlapping tokens between chunks when splitting the input text.*/27 unmodified lines/*** The predicted label for that group of tokens*/entity_group?: string;label: unknown;/*** The associated score / probability
19 unmodified lines202122232425264 unmodified lines3132333435363719 unmodified lines"description": "Additional inference parameters for Token Classification","type": "object","properties": {"ignoreLabels": {"type": "array","items": {"type": "string"4 unmodified lines"type": "integer","description": "The number of overlapping tokens between chunks when splitting the input text."},"aggregationStrategy": {"title": "TokenClassificationAggregationStrategy","type": "string","description": "The strategy used to fuse tokens based on model predictions",19 unmodified lines202122232425264 unmodified lines3132333435363719 unmodified lines"description": "Additional inference parameters for Token Classification","type": "object","properties": {"ignore_labels": {"type": "array","items": {"type": "string"4 unmodified lines"type": "integer","description": "The number of overlapping tokens between chunks when splitting the input text."},"aggregation_strategy": {"title": "TokenClassificationAggregationStrategy","type": "string","description": "The strategy used to fuse tokens based on model predictions",
6 unmodified lines789101112136 unmodified lines"items": {"type": "object","properties": {"entityGroup": {"type": "string","description": "The predicted label for that group of tokens"},6 unmodified lines789101112136 unmodified lines"items": {"type": "object","properties": {"entity_group": {"type": "string","description": "The predicted label for that group of tokens"},
29 unmodified lines30313233343536373839409 unmodified lines50515253545556575829 unmodified lines/*** Whether to clean up the potential extra spaces in the text output.*/cleanUpTokenizationSpaces?: boolean;/*** Additional parametrization of the text generation algorithm*/generateParameters?: { [key: string]: unknown };/*** The truncation strategy to use*/9 unmodified lines* Outputs of inference for the Text2text Generation task*/export interface TranslationOutput {/*** The generated text.*/generatedText: string;[property: string]: unknown;}29 unmodified lines30313233343536373839409 unmodified lines5051525354555657585929 unmodified lines/*** 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?: { [key: string]: unknown };/*** The truncation strategy to use*/9 unmodified lines* Outputs of inference for the Text2text Generation task*/export interface TranslationOutput {generatedText: unknown;/*** The generated text.*/generated_text?: string;[property: string]: unknown;}
25 unmodified lines2627282930313233343536373839404125 unmodified lines/*** The sampling rate used to select frames from the video.*/frameSamplingRate?: number;functionToApply?: ClassificationOutputTransform;/*** The number of sampled frames to consider for classification.*/numFrames?: number;/*** When specified, limits the output to the top K most probable classes.*/topK?: number;[property: string]: unknown;}/**25 unmodified lines2627282930313233343536373839404125 unmodified lines/*** The sampling rate used to select frames from the video.*/frame_sampling_rate?: number;function_to_apply?: ClassificationOutputTransform;/*** The number of sampled frames to consider for classification.*/num_frames?: number;/*** When specified, limits the output to the top K most probable classes.*/top_k?: number;[property: string]: unknown;}/**
18 unmodified lines1920212223242526272829303132333435363718 unmodified lines"description": "Additional inference parameters for Video Classification","type": "object","properties": {"functionToApply": {"title": "TextClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"numFrames": {"type": "integer","description": "The number of sampled frames to consider for classification."},"frameSamplingRate": {"type": "integer","description": "The sampling rate used to select frames from the video."},"topK": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}18 unmodified lines1920212223242526272829303132333435363718 unmodified lines"description": "Additional inference parameters for Video Classification","type": "object","properties": {"function_to_apply": {"title": "TextClassificationOutputTransform","$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"},"num_frames": {"type": "integer","description": "The number of sampled frames to consider for classification."},"frame_sampling_rate": {"type": "integer","description": "The sampling rate used to select frames from the video."},"top_k": {"type": "integer","description": "When specified, limits the output to the top K most probable classes."}
41 unmodified lines4243444546474841 unmodified lines* return less than topk answers if there are not enough options available within the* context.*/topK?: number;[property: string]: unknown;}export type VisualQuestionAnsweringOutput = VisualQuestionAnsweringOutputElement[];41 unmodified lines4243444546474841 unmodified lines* return less than topk answers if there are not enough options available within the* context.*/top_k?: number;[property: string]: unknown;}export type VisualQuestionAnsweringOutput = VisualQuestionAnsweringOutputElement[];
packages/tasks/scripts/inference-codegen.ts+1-1
packages/tasks/src/tasks/audio-classification/inference.ts+3-3
packages/tasks/src/tasks/audio-classification/spec/input.json+2-2
packages/tasks/src/tasks/audio-classification/spec/output.json+1-12
packages/tasks/src/tasks/automatic-speech-recognition/inference.ts+34-29
packages/tasks/src/tasks/automatic-speech-recognition/spec/input.json+1-1
packages/tasks/src/tasks/automatic-speech-recognition/spec/output.json+30-28
packages/tasks/src/tasks/common-definitions.json+25-17
packages/tasks/src/tasks/depth-estimation/inference.ts+1-1
packages/tasks/src/tasks/document-question-answering/inference.ts+15-7
packages/tasks/src/tasks/document-question-answering/spec/input.json+7-7
packages/tasks/src/tasks/document-question-answering/spec/output.json+2-2
packages/tasks/src/tasks/fill-mask/inference.ts+3-2
packages/tasks/src/tasks/fill-mask/spec/input.json+1-1
packages/tasks/src/tasks/fill-mask/spec/output.json+1-1
packages/tasks/src/tasks/image-classification/inference.ts+2-2
packages/tasks/src/tasks/image-classification/spec/input.json+2-2
packages/tasks/src/tasks/image-segmentation/inference.ts+2-2
packages/tasks/src/tasks/image-segmentation/spec/input.json+2-2
packages/tasks/src/tasks/image-to-image/inference.ts+4-4
packages/tasks/src/tasks/image-to-image/spec/input.json+4-4
packages/tasks/src/tasks/image-to-text/inference.ts+24-19
packages/tasks/src/tasks/image-to-text/spec/input.json+1-1
packages/tasks/src/tasks/image-to-text/spec/output.json+8-11
packages/tasks/src/tasks/placeholder/spec/input.json+2-2
packages/tasks/src/tasks/placeholder/spec/output.json+1-1
packages/tasks/src/tasks/question-answering/inference.ts+7-7
packages/tasks/src/tasks/question-answering/spec/input.json+7-7
packages/tasks/src/tasks/summarization/inference.ts+4-3
packages/tasks/src/tasks/text-classification/inference.ts+2-2
packages/tasks/src/tasks/text-classification/spec/input.json+2-2
packages/tasks/src/tasks/text-generation/inference.ts+14-11
packages/tasks/src/tasks/text-generation/spec/input.json+8-8
packages/tasks/src/tasks/text-generation/spec/output.json+8-11
packages/tasks/src/tasks/text-to-audio/inference.ts+23-18
packages/tasks/src/tasks/text-to-audio/spec/output.json+10-13
packages/tasks/src/tasks/text-to-image/inference.ts+5-7
packages/tasks/src/tasks/text-to-image/spec/input.json+4-4
packages/tasks/src/tasks/text-to-image/spec/output.json+7-9
packages/tasks/src/tasks/text-to-speech/inference.ts+17-16
packages/tasks/src/tasks/text2text-generation/inference.ts+9-7
packages/tasks/src/tasks/text2text-generation/spec/input.json+2-2
packages/tasks/src/tasks/text2text-generation/spec/output.json+8-11
packages/tasks/src/tasks/token-classification/inference.ts+3-3
packages/tasks/src/tasks/token-classification/spec/input.json+2-2
packages/tasks/src/tasks/token-classification/spec/output.json+1-1
packages/tasks/src/tasks/translation/inference.ts+4-3
packages/tasks/src/tasks/video-classification/inference.ts+4-4
packages/tasks/src/tasks/video-classification/spec/input.json+4-4
packages/tasks/src/tasks/visual-question-answering/inference.ts+1-1