Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bot] Update API inference documentation #1499

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/audio-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input audio data as a base64-encoded string. If no `parameters` are provided, you can also provide the audio data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Audio Classification |
| **parameters** | _object_ | |
| **        function_to_apply** | _enum_ | Possible values: sigmoid, softmax, none. |
| **        top_k** | _integer_ | When specified, limits the output to the top K most probable classes. |

Expand Down
4 changes: 2 additions & 2 deletions docs/api-inference/tasks/automatic-speech-recognition.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input audio data as a base64-encoded string. If no `parameters` are provided, you can also provide the audio data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Automatic Speech Recognition |
| **parameters** | _object_ | |
| **        return_timestamps** | _boolean_ | Whether to output corresponding timestamps with the generated text |
| **        generation_parameters** | _object_ | Ad-hoc parametrization of the text generation process |
| **        generation_parameters** | _object_ | |
| **                temperature** | _number_ | The value used to modulate the next token probabilities. |
| **                top_k** | _integer_ | The number of highest probability vocabulary tokens to keep for top-k-filtering. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top_p** | _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. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/fill-mask.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The text with masked tokens |
| **parameters** | _object_ | Additional inference parameters for Fill Mask |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top_k** | _integer_ | When passed, overrides the number of predictions to return. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;targets** | _string[]_ | When passed, the model will limit the scores to the passed targets instead of looking up in the whole vocabulary. If the provided targets are not in the model vocab, they will be tokenized and the first resulting token will be used (with a warning, and that might be slower). |

Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/image-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Image Classification |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function_to_apply** | _enum_ | Possible values: sigmoid, softmax, none. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top_k** | _integer_ | When specified, limits the output to the top K most probable classes. |

Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/image-segmentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Image Segmentation |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mask_threshold** | _number_ | Threshold to use when turning the predicted masks into binary values. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;overlap_mask_area_threshold** | _number_ | Mask overlap threshold to eliminate small, disconnected segments. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subtask** | _enum_ | Possible values: instance, panoptic, semantic. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/image-to-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ No snippet available for this task.
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Image To Image |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guidance_scale** | _number_ | 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. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string[]_ | One or several prompt to guide what NOT to include in image generation. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_inference_steps** | _integer_ | For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/object-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload. |
| **parameters** | _object_ | Additional inference parameters for Object Detection |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threshold** | _number_ | The probability necessary to make a prediction. |


Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/question-answering.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| **inputs*** | _object_ | One (context, question) pair to answer |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context*** | _string_ | The context to be used for answering the question |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;question*** | _string_ | The question to be answered |
| **parameters** | _object_ | Additional inference parameters for Question Answering |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top_k** | _integer_ | 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. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doc_stride** | _integer_ | 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. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max_answer_len** | _integer_ | The maximum length of predicted answers (e.g., only answers with a shorter length are considered). |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/summarization.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input text to summarize. |
| **parameters** | _object_ | Additional inference parameters for summarization. |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clean_up_tokenization_spaces** | _boolean_ | Whether to clean up the potential extra spaces in the text output. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;truncation** | _enum_ | Possible values: do_not_truncate, longest_first, only_first, only_second. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generate_parameters** | _object_ | Additional parametrization of the text generation algorithm. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/table-question-answering.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| **inputs*** | _object_ | One (table, question) pair to answer |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table*** | _object_ | The table to serve as context for the questions |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;question*** | _string_ | The question to be answered about the table |
| **parameters** | _object_ | Additional inference parameters for Table Question Answering |
| **parameters** | _object_ | |


Some options can be configured by passing headers to the Inference API. Here are the available headers:
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/text-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The text to classify |
| **parameters** | _object_ | Additional inference parameters for Text Classification |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function_to_apply** | _enum_ | Possible values: sigmoid, softmax, none. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top_k** | _integer_ | When specified, limits the output to the top K most probable classes. |

Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/text-to-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input text data (sometimes called "prompt") |
| **parameters** | _object_ | Additional inference parameters for Text To Image |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guidance_scale** | _number_ | A higher guidance scale value encourages the model to generate images closely linked to the text prompt, but values too high may cause saturation and other artifacts. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string[]_ | One or several prompt to guide what NOT to include in image generation. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_inference_steps** | _integer_ | The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/token-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The input text data |
| **parameters** | _object_ | Additional inference parameters for Token Classification |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ignore_labels** | _string[]_ | A list of labels to ignore |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stride** | _integer_ | The number of overlapping tokens between chunks when splitting the input text. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aggregation_strategy** | _string_ | One of the following: |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The text to translate. |
| **parameters** | _object_ | Additional inference parameters for Translation |
| **parameters** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src_lang** | _string_ | The source language of the text. Required for models that can translate from multiple languages. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tgt_lang** | _string_ | Target language to translate to. Required for models that can translate to multiple languages. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clean_up_tokenization_spaces** | _boolean_ | Whether to clean up the potential extra spaces in the text output. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/zero-shot-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
| Payload | | |
| :--- | :--- | :--- |
| **inputs*** | _string_ | The text to classify |
| **parameters*** | _object_ | Additional inference parameters for Zero Shot Classification |
| **parameters*** | _object_ | |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;candidate_labels*** | _string[]_ | The set of possible class labels to classify the text into. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hypothesis_template** | _string_ | The sentence used in conjunction with `candidate_labels` to attempt the text classification by replacing the placeholder with the candidate labels. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multi_label** | _boolean_ | Whether multiple candidate labels can be true. If false, the scores are normalized such that the sum of the label likelihoods for each sequence is 1. If true, the labels are considered independent and probabilities are normalized for each candidate. |
Expand Down
Loading