File size: 430 Bytes
95a4065
9b26cca
c70c369
9b26cca
8931deb
c70c369
 
9b26cca
 
 
 
 
 
 
 
 
 
c70c369
9b26cca
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    api_key=os.environ["HF"],
)

stream = client.chat.completions.create(
    model="deepreinforce-ai/Ornith-1.0-9B:featherless-ai",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content, end="")