Skip to content

Commit bef1e90

Browse files
Update docs/hub/models-inference.md
Co-authored-by: Simon Brandeis <[email protected]>
1 parent 111aec5 commit bef1e90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/hub/models-inference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ You can integrate Inference Providers into your own applications using our SDKs
2323
```python
2424
from huggingface_hub import InferenceClient
2525

26-
client = InferenceClient(provider="auto") # Automatically selects best provider
26+
import os
27+
28+
client = InferenceClient(
29+
api_key=os.environ["HF_TOKEN"],
30+
provider="auto", # Automatically selects best provider
31+
)
2732

2833
# Chat completion
2934
completion = client.chat.completions.create(

0 commit comments

Comments
 (0)