good catch from copilot

This commit is contained in:
Julien Chaumond 2025-05-01 16:40:51 +02:00
parent bb6fc3205c
commit fc2631547e
No known key found for this signature in database
GPG Key ID: 2776F99F2C147772
2 changed files with 5 additions and 5 deletions

View File

@ -139,12 +139,12 @@ npm install @huggingface/inference
Whether you use Inference Providers (our serverless API), or Inference Endpoints, you can call `InferenceClient`. Whether you use Inference Providers (our serverless API), or Inference Endpoints, you can call `InferenceClient`.
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). We can create a `InferenceClient` providing our endpoint URL and [Hugging Face access token](https://huggingface.co/settings/tokens).
```js ```js
import { HfInferenceEndpoint } from "@huggingface/inference"; import { InferenceClient } from "@huggingface/inference";
const client = new InferenceEndpoint('hf_YOUR_TOKEN', { endpointUrl: 'https://YOUR_ENDPOINT.endpoints.huggingface.cloud' }); const client = new InferenceClient('hf_YOUR_TOKEN', { endpointUrl: 'https://YOUR_ENDPOINT.endpoints.huggingface.cloud' });
const prompt = const prompt =
"![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png)What is this a picture of?\n\n"; "![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png)What is this a picture of?\n\n";

View File

@ -134,9 +134,9 @@ Whether you use Inference Providers (our serverless API), or Inference Endpoints
```js ```js
import { InferenceEndpoint } from '@huggingface/inference'; import { InferenceClient } from '@huggingface/inference';
const client = new InferenceEndpoint('hf_YOUR_TOKEN', { endpointUrl: 'https://YOUR_ENDPOINT.endpoints.huggingface.cloud' }); const client = new InferenceClient('hf_YOUR_TOKEN', { endpointUrl: 'https://YOUR_ENDPOINT.endpoints.huggingface.cloud' });
// prompt // prompt
const prompt = 'What can you do in Nuremberg, Germany? Give me 3 Tips'; const prompt = 'What can you do in Nuremberg, Germany? Give me 3 Tips';