Skip to content

Conversation

@julien-c
Copy link
Member

@julien-c julien-c commented May 1, 2025

This PR updates client SDK snippets in the documentation to reflect new API usage and improved consistency. Key changes include:

  • Updating the JavaScript snippets in streaming.md to use the new InferenceEndpoint class and improved formatting.
  • Revising the Python examples in visual_language_models.md to instantiate InferenceClient with the base_url parameter.
  • Adjusting README.md copy to refer to Inference Endpoints in the plural form.

(from #3207 (review))

@julien-c julien-c requested review from Wauplin and hanouticelina May 1, 2025 14:36
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@julien-c julien-c requested review from Copilot and drbh May 1, 2025 14:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates client SDK snippets in the documentation to reflect new API usage and improved consistency. Key changes include:

  • Updating the JavaScript snippets in streaming.md to use the new InferenceEndpoint class and improved formatting.
  • Revising the Python examples in visual_language_models.md to instantiate InferenceClient with the base_url parameter.
  • Adjusting README.md copy to refer to Inference Endpoints in the plural form.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/source/conceptual/streaming.md Updated bash snippet formatting and switched JavaScript usage from HfInferenceEndpoint to InferenceEndpoint.
docs/source/basic_tutorials/visual_language_models.md Revised Python code instantiation and updated the JavaScript snippet, but the import statement still references HfInferenceEndpoint.
README.md Minor text update to refer to Inference Endpoints.
Comments suppressed due to low confidence (2)

docs/source/basic_tutorials/visual_language_models.md:145

  • The import statement still uses HfInferenceEndpoint while the instantiation later uses InferenceEndpoint. Please update the import to import InferenceEndpoint to ensure consistency.
import { HfInferenceEndpoint } from "@huggingface/inference";

docs/source/basic_tutorials/visual_language_models.md:142

  • There is duplicate phrasing in this sentence. Please remove one of the duplicated parts to improve clarity.
We can create a `HfInferenceEndpoint` providing our endpoint URL and We can create a `HfInferenceEndpoint` providing our endpoint URL and [Hugging Face access token](https://huggingface.co/settings/tokens).

Copy link
Collaborator

@drbh drbh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👌

Copy link
Contributor

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Narsil Narsil merged commit 7253be3 into main May 1, 2025
4 checks passed
@Narsil Narsil deleted the hfjs branch May 1, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants