From 05fd71dd0710e94fd8fd9797fa2f194006b670f9 Mon Sep 17 00:00:00 2001 From: sergiopaniego <sergiopaniegoblanco@gmail.com> Date: Mon, 18 Nov 2024 18:07:34 +0100 Subject: [PATCH 1/3] Fixed typos in InferenceClient hyperlinks --- docs/api-inference/tasks/automatic-speech-recognition.md | 2 +- docs/api-inference/tasks/image-text-to-text.md | 2 +- docs/api-inference/tasks/table-question-answering.md | 2 +- docs/api-inference/tasks/text-to-image.md | 2 +- docs/api-inference/tasks/zero-shot-classification.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api-inference/tasks/automatic-speech-recognition.md b/docs/api-inference/tasks/automatic-speech-recognition.md index 819bbf862..d329a1715 100644 --- a/docs/api-inference/tasks/automatic-speech-recognition.md +++ b/docs/api-inference/tasks/automatic-speech-recognition.md @@ -64,7 +64,7 @@ def query(filename): output = query("sample1.flac") ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.automatic_speech-recognition). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.automatic_speech_recognition). </python> <js> diff --git a/docs/api-inference/tasks/image-text-to-text.md b/docs/api-inference/tasks/image-text-to-text.md index ee60dd020..5b42d9690 100644 --- a/docs/api-inference/tasks/image-text-to-text.md +++ b/docs/api-inference/tasks/image-text-to-text.md @@ -86,7 +86,7 @@ for chunk in stream: print(chunk.choices[0].delta.content, end="") ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.image_text-to-text). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.image_text_to_text). </python> <js> diff --git a/docs/api-inference/tasks/table-question-answering.md b/docs/api-inference/tasks/table-question-answering.md index a460c6177..ef1757e67 100644 --- a/docs/api-inference/tasks/table-question-answering.md +++ b/docs/api-inference/tasks/table-question-answering.md @@ -71,7 +71,7 @@ output = query({ }) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.table_question-answering). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.table_question_answering). </python> <js> diff --git a/docs/api-inference/tasks/text-to-image.md b/docs/api-inference/tasks/text-to-image.md index 6e01b9b43..dfb49410f 100644 --- a/docs/api-inference/tasks/text-to-image.md +++ b/docs/api-inference/tasks/text-to-image.md @@ -74,7 +74,7 @@ from PIL import Image image = Image.open(io.BytesIO(image_bytes)) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.text_to-image). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.text_to_image). </python> <js> diff --git a/docs/api-inference/tasks/zero-shot-classification.md b/docs/api-inference/tasks/zero-shot-classification.md index f7e50572f..a10b80f81 100644 --- a/docs/api-inference/tasks/zero-shot-classification.md +++ b/docs/api-inference/tasks/zero-shot-classification.md @@ -61,7 +61,7 @@ output = query({ }) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.zero_shot-classification). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.zero_shot_classification). </python> <js> From d230a52d4261d12225141638a31135517dde8ba8 Mon Sep 17 00:00:00 2001 From: sergiopaniego <sergiopaniegoblanco@gmail.com> Date: Tue, 19 Nov 2024 18:06:21 +0100 Subject: [PATCH 2/3] Updated replace to replaceAll ocurrences in url patterns --- scripts/api-inference/scripts/generate.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/api-inference/scripts/generate.ts b/scripts/api-inference/scripts/generate.ts index c6e48a58e..cae879700 100644 --- a/scripts/api-inference/scripts/generate.ts +++ b/scripts/api-inference/scripts/generate.ts @@ -440,8 +440,8 @@ TASKS.forEach((task) => { }; DATA.snippets[task] = SNIPPETS_TEMPLATE({ taskSnippets, - taskSnakeCase: task.replace("-", "_"), - taskAttached: task.replace("-", ""), + taskSnakeCase: task.replaceAll("-", "_"), + taskAttached: task.replaceAll("-", ""), }); }); @@ -511,8 +511,8 @@ function fetchChatCompletion() { }; DATA.snippets[task.name] = SNIPPETS_TEMPLATE({ taskSnippets, - taskSnakeCase: baseName.replace("-", "_"), - taskAttached: baseName.replace("-", ""), + taskSnakeCase: baseName.replaceAll("-", "_"), + taskAttached: baseName.replaceAll("-", ""), }); }); From 6deb486821a5e0a7f63305247352d84e9162bf66 Mon Sep 17 00:00:00 2001 From: sergiopaniego <sergiopaniegoblanco@gmail.com> Date: Tue, 19 Nov 2024 18:09:55 +0100 Subject: [PATCH 3/3] Reverted update of inferenceClient hyperlinks --- docs/api-inference/tasks/automatic-speech-recognition.md | 2 +- docs/api-inference/tasks/image-text-to-text.md | 2 +- docs/api-inference/tasks/table-question-answering.md | 2 +- docs/api-inference/tasks/text-to-image.md | 2 +- docs/api-inference/tasks/zero-shot-classification.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api-inference/tasks/automatic-speech-recognition.md b/docs/api-inference/tasks/automatic-speech-recognition.md index d329a1715..819bbf862 100644 --- a/docs/api-inference/tasks/automatic-speech-recognition.md +++ b/docs/api-inference/tasks/automatic-speech-recognition.md @@ -64,7 +64,7 @@ def query(filename): output = query("sample1.flac") ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.automatic_speech_recognition). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.automatic_speech-recognition). </python> <js> diff --git a/docs/api-inference/tasks/image-text-to-text.md b/docs/api-inference/tasks/image-text-to-text.md index 5b42d9690..ee60dd020 100644 --- a/docs/api-inference/tasks/image-text-to-text.md +++ b/docs/api-inference/tasks/image-text-to-text.md @@ -86,7 +86,7 @@ for chunk in stream: print(chunk.choices[0].delta.content, end="") ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.image_text_to_text). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.image_text-to-text). </python> <js> diff --git a/docs/api-inference/tasks/table-question-answering.md b/docs/api-inference/tasks/table-question-answering.md index ef1757e67..a460c6177 100644 --- a/docs/api-inference/tasks/table-question-answering.md +++ b/docs/api-inference/tasks/table-question-answering.md @@ -71,7 +71,7 @@ output = query({ }) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.table_question_answering). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.table_question-answering). </python> <js> diff --git a/docs/api-inference/tasks/text-to-image.md b/docs/api-inference/tasks/text-to-image.md index dfb49410f..6e01b9b43 100644 --- a/docs/api-inference/tasks/text-to-image.md +++ b/docs/api-inference/tasks/text-to-image.md @@ -74,7 +74,7 @@ from PIL import Image image = Image.open(io.BytesIO(image_bytes)) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.text_to_image). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.text_to-image). </python> <js> diff --git a/docs/api-inference/tasks/zero-shot-classification.md b/docs/api-inference/tasks/zero-shot-classification.md index a10b80f81..f7e50572f 100644 --- a/docs/api-inference/tasks/zero-shot-classification.md +++ b/docs/api-inference/tasks/zero-shot-classification.md @@ -61,7 +61,7 @@ output = query({ }) ``` -To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.zero_shot_classification). +To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.zero_shot-classification). </python> <js>