Skip to content

Commit

Permalink
regenerate inference api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hanouticelina committed Oct 16, 2024
1 parent 05b8858 commit b94abfa
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 38 deletions.
9 changes: 5 additions & 4 deletions docs/api-inference/tasks/audio-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ For more details about the `audio-classification` task, check out its [dedicated

### Recommended models

- [ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition](https://huggingface.co/ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition): An emotion recognition model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=audio-classification&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=audio-classification&sort=trending).

### Using the API

Expand All @@ -39,7 +40,7 @@ This is only a subset of the supported models. Find the model that suits you bes

<curl>
```bash
curl https://api-inference.huggingface.co/models/<REPO_ID> \
curl https://api-inference.huggingface.co/models/ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition \
-X POST \
--data-binary '@sample1.flac' \
-H "Authorization: Bearer hf_***"
Expand All @@ -50,7 +51,7 @@ curl https://api-inference.huggingface.co/models/<REPO_ID> \
```py
import requests

API_URL = "https://api-inference.huggingface.co/models/<REPO_ID>"
API_URL = "https://api-inference.huggingface.co/models/ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition"
headers = {"Authorization": "Bearer hf_***"}

def query(filename):
Expand All @@ -70,7 +71,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
async function query(filename) {
const data = fs.readFileSync(filename);
const response = await fetch(
"https://api-inference.huggingface.co/models/<REPO_ID>",
"https://api-inference.huggingface.co/models/ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition",
{
headers: {
Authorization: "Bearer hf_***"
Expand Down
3 changes: 1 addition & 2 deletions docs/api-inference/tasks/automatic-speech-recognition.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ For more details about the `automatic-speech-recognition` task, check out its [d
### Recommended models

- [openai/whisper-large-v3](https://huggingface.co/openai/whisper-large-v3): A powerful ASR model by OpenAI.
- [facebook/seamless-m4t-v2-large](https://huggingface.co/facebook/seamless-m4t-v2-large): An end-to-end model that performs ASR and Speech Translation by MetaAI.
- [pyannote/speaker-diarization-3.1](https://huggingface.co/pyannote/speaker-diarization-3.1): Powerful speaker diarization model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=automatic-speech-recognition&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=automatic-speech-recognition&sort=trending).

### Using the API

Expand Down
9 changes: 5 additions & 4 deletions docs/api-inference/tasks/chat-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This is a subtask of [`text-generation`](https://huggingface.co/docs/api-inferen

#### Conversational Vision-Language Models (VLMs)

- [meta-llama/Llama-3.2-11B-Vision-Instruct](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct): Powerful vision language model with great visual understanding and reasoning capabilities.
- [microsoft/Phi-3.5-vision-instruct](https://huggingface.co/microsoft/Phi-3.5-vision-instruct): Strong image-text-to-text model.

### Using the API
Expand Down Expand Up @@ -106,11 +107,11 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
<curl>
```bash
curl 'https://api-inference.huggingface.co/models/microsoft/Phi-3.5-vision-instruct/v1/chat/completions' \
curl 'https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct/v1/chat/completions' \
-H "Authorization: Bearer hf_***" \
-H 'Content-Type: application/json' \
-d '{
"model": "microsoft/Phi-3.5-vision-instruct",
"model": "meta-llama/Llama-3.2-11B-Vision-Instruct",
"messages": [
{
"role": "user",
Expand All @@ -136,7 +137,7 @@ client = InferenceClient(api_key="hf_***")
image_url = "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"

for message in client.chat_completion(
model="microsoft/Phi-3.5-vision-instruct",
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
messages=[
{
"role": "user",
Expand All @@ -163,7 +164,7 @@ const inference = new HfInference("hf_***");
const imageUrl = "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg";

for await (const chunk of inference.chatCompletionStream({
model: "microsoft/Phi-3.5-vision-instruct",
model: "meta-llama/Llama-3.2-11B-Vision-Instruct",
messages: [
{
"role": "user",
Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/feature-extraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For more details about the `feature-extraction` task, check out its [dedicated p

- [thenlper/gte-large](https://huggingface.co/thenlper/gte-large): A powerful feature extraction model for natural language processing tasks.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=feature-extraction&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=feature-extraction&sort=trending).

### Using the API

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 @@ -27,7 +27,7 @@ For more details about the `fill-mask` task, check out its [dedicated page](http
- [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased): The famous BERT model.
- [FacebookAI/xlm-roberta-base](https://huggingface.co/FacebookAI/xlm-roberta-base): A multilingual model trained on 100 languages.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=fill-mask&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=fill-mask&sort=trending).

### Using the API

Expand Down
3 changes: 2 additions & 1 deletion docs/api-inference/tasks/image-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ For more details about the `image-classification` task, check out its [dedicated
### Recommended models

- [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224): A strong image classification model.
- [facebook/deit-base-distilled-patch16-224](https://huggingface.co/facebook/deit-base-distilled-patch16-224): A robust image classification model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-classification&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-classification&sort=trending).

### Using the API

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 @@ -26,7 +26,7 @@ For more details about the `image-segmentation` task, check out its [dedicated p

- [nvidia/segformer-b0-finetuned-ade-512-512](https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512): Semantic segmentation model trained on ADE20k benchmark dataset with 512x512 resolution.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-segmentation&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-segmentation&sort=trending).

### Using the API

Expand Down
11 changes: 6 additions & 5 deletions docs/api-inference/tasks/image-text-to-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ For more details about the `image-text-to-text` task, check out its [dedicated p

### Recommended models

- [meta-llama/Llama-3.2-11B-Vision-Instruct](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct): Powerful vision language model with great visual understanding and reasoning capabilities.
- [HuggingFaceM4/idefics2-8b-chatty](https://huggingface.co/HuggingFaceM4/idefics2-8b-chatty): Cutting-edge conversational vision language model that can take multiple image inputs.
- [microsoft/Phi-3.5-vision-instruct](https://huggingface.co/microsoft/Phi-3.5-vision-instruct): Strong image-text-to-text model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-text-to-text&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-text-to-text&sort=trending).

### Using the API

Expand All @@ -36,7 +37,7 @@ This is only a subset of the supported models. Find the model that suits you bes

<curl>
```bash
curl https://api-inference.huggingface.co/models/HuggingFaceM4/idefics2-8b-chatty \
curl https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct \
-X POST \
-d '{"inputs": No input example has been defined for this model task.}' \
-H 'Content-Type: application/json' \
Expand All @@ -48,7 +49,7 @@ curl https://api-inference.huggingface.co/models/HuggingFaceM4/idefics2-8b-chatt
```py
import requests

API_URL = "https://api-inference.huggingface.co/models/HuggingFaceM4/idefics2-8b-chatty"
API_URL = "https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct"
headers = {"Authorization": "Bearer hf_***"}

from huggingface_hub import InferenceClient
Expand All @@ -58,7 +59,7 @@ client = InferenceClient(api_key="hf_***")
image_url = "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"

for message in client.chat_completion(
model="HuggingFaceM4/idefics2-8b-chatty",
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
messages=[
{
"role": "user",
Expand All @@ -81,7 +82,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
```js
async function query(data) {
const response = await fetch(
"https://api-inference.huggingface.co/models/HuggingFaceM4/idefics2-8b-chatty",
"https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct",
{
headers: {
Authorization: "Bearer hf_***"
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 @@ -31,7 +31,7 @@ For more details about the `image-to-image` task, check out its [dedicated page]

- [timbrooks/instruct-pix2pix](https://huggingface.co/timbrooks/instruct-pix2pix): A model that takes an image and an instruction to edit the image.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-to-image&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-to-image&sort=trending).

### Using the API

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 @@ -27,7 +27,7 @@ For more details about the `object-detection` task, check out its [dedicated pag
- [facebook/detr-resnet-50](https://huggingface.co/facebook/detr-resnet-50): Solid object detection model trained on the benchmark dataset COCO 2017.
- [microsoft/beit-base-patch16-224-pt22k-ft22k](https://huggingface.co/microsoft/beit-base-patch16-224-pt22k-ft22k): Strong object detection model trained on ImageNet-21k dataset.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=object-detection&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=object-detection&sort=trending).

### Using the API

Expand Down
3 changes: 1 addition & 2 deletions docs/api-inference/tasks/question-answering.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ For more details about the `question-answering` task, check out its [dedicated p

- [deepset/roberta-base-squad2](https://huggingface.co/deepset/roberta-base-squad2): A robust baseline model for most question answering domains.
- [distilbert/distilbert-base-cased-distilled-squad](https://huggingface.co/distilbert/distilbert-base-cased-distilled-squad): Small yet robust model that can answer questions.
- [google/tapas-base-finetuned-wtq](https://huggingface.co/google/tapas-base-finetuned-wtq): A special model that can answer questions from tables.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=question-answering&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=question-answering&sort=trending).

### Using the API

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 @@ -26,7 +26,7 @@ For more details about the `summarization` task, check out its [dedicated page](

- [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn): A strong summarization model trained on English news articles. Excels at generating factual summaries.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=summarization&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=summarization&sort=trending).

### Using the API

Expand Down
9 changes: 4 additions & 5 deletions docs/api-inference/tasks/table-question-answering.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ For more details about the `table-question-answering` task, check out its [dedic

### Recommended models

- [google/tapas-base-finetuned-wtq](https://huggingface.co/google/tapas-base-finetuned-wtq): A robust table question answering model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=table-question-answering&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=table-question-answering&sort=trending).

### Using the API

Expand All @@ -35,7 +34,7 @@ This is only a subset of the supported models. Find the model that suits you bes

<curl>
```bash
curl https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq \
curl https://api-inference.huggingface.co/models/<REPO_ID> \
-X POST \
-d '{"inputs": { "query": "How many stars does the transformers repository have?", "table": { "Repository": ["Transformers", "Datasets", "Tokenizers"], "Stars": ["36542", "4512", "3934"], "Contributors": ["651", "77", "34"], "Programming language": [ "Python", "Python", "Rust, Python and NodeJS" ] } }}' \
-H 'Content-Type: application/json' \
Expand All @@ -47,7 +46,7 @@ curl https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq
```py
import requests

API_URL = "https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq"
API_URL = "https://api-inference.huggingface.co/models/<REPO_ID>"
headers = {"Authorization": "Bearer hf_***"}

def query(payload):
Expand Down Expand Up @@ -78,7 +77,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
```js
async function query(data) {
const response = await fetch(
"https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq",
"https://api-inference.huggingface.co/models/<REPO_ID>",
{
headers: {
Authorization: "Bearer hf_***"
Expand Down
3 changes: 2 additions & 1 deletion docs/api-inference/tasks/text-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ For more details about the `text-classification` task, check out its [dedicated
- [ProsusAI/finbert](https://huggingface.co/ProsusAI/finbert): A sentiment analysis model specialized in financial sentiment.
- [cardiffnlp/twitter-roberta-base-sentiment-latest](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest): A sentiment analysis model specialized in analyzing tweets.
- [papluca/xlm-roberta-base-language-detection](https://huggingface.co/papluca/xlm-roberta-base-language-detection): A model that can classify languages.
- [meta-llama/Prompt-Guard-86M](https://huggingface.co/meta-llama/Prompt-Guard-86M): A model that can classify text generation attacks.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-classification&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-classification&sort=trending).

### Using the API

Expand Down
2 changes: 1 addition & 1 deletion docs/api-inference/tasks/text-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For more details about the `text-generation` task, check out its [dedicated page
- [HuggingFaceH4/starchat2-15b-v0.1](https://huggingface.co/HuggingFaceH4/starchat2-15b-v0.1): Strong coding assistant model.
- [mistralai/Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407): Very strong open-source large language model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-generation&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-generation&sort=trending).

### Using the API

Expand Down
3 changes: 1 addition & 2 deletions docs/api-inference/tasks/text-to-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ For more details about the `text-to-image` task, check out its [dedicated page](
### Recommended models

- [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev): One of the most powerful image generation models that can generate realistic outputs.
- [latent-consistency/lcm-lora-sdxl](https://huggingface.co/latent-consistency/lcm-lora-sdxl): A powerful yet fast image generation model.
- [stabilityai/stable-diffusion-3-medium-diffusers](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers): A powerful text-to-image model.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-to-image&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-to-image&sort=trending).

### Using the API

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 @@ -29,7 +29,7 @@ For more details about the `token-classification` task, check out its [dedicated
- [blaze999/Medical-NER](https://huggingface.co/blaze999/Medical-NER): A token classification model specialized on medical entity recognition.
- [flair/ner-english](https://huggingface.co/flair/ner-english): Flair models are typically the state of the art in named entity recognition tasks.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=token-classification&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=token-classification&sort=trending).

### Using the API

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 @@ -26,7 +26,7 @@ For more details about the `translation` task, check out its [dedicated page](ht

- [google-t5/t5-base](https://huggingface.co/google-t5/t5-base): A general-purpose Transformer that can be used to translate from English to German, French, or Romanian.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=translation&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=translation&sort=trending).

### Using the API

Expand Down
3 changes: 1 addition & 2 deletions docs/api-inference/tasks/zero-shot-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ For more details about the `zero-shot-classification` task, check out its [dedic
### Recommended models

- [facebook/bart-large-mnli](https://huggingface.co/facebook/bart-large-mnli): Powerful zero-shot text classification model.
- [MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7): Powerful zero-shot multilingual text classification model that can accomplish multiple tasks.

This is only a subset of the supported models. Find the model that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=zero-shot-classification&sort=trending).
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=zero-shot-classification&sort=trending).

### Using the API

Expand Down
Loading

0 comments on commit b94abfa

Please sign in to comment.