mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-09 03:14:53 +00:00
good catch from copilot
This commit is contained in:
parent
bb6fc3205c
commit
fc2631547e
@ -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 =
|
||||||
"What is this a picture of?\n\n";
|
"What is this a picture of?\n\n";
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user