Skip to content

Commit 798f456

Browse files
committed
use openai client
1 parent 5c7625f commit 798f456

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/hub/models-inference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ Or, you can just use the OpenAI API compatible client.
5151

5252
```python
5353
import os
54-
from huggingface_hub import InferenceClient
54+
from openai import OpenAI
5555

56-
client = InferenceClient(
56+
client = OpenAI(
57+
base_url="https://router.huggingface.co/v1",
5758
api_key=os.environ["HF_TOKEN"],
5859
)
5960

0 commit comments

Comments
 (0)