Ahiyan commited on
Commit
ba86837
·
verified ·
1 Parent(s): 66c88d9
Files changed (1) hide show
  1. r2 +20 -0
r2 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import InferenceClient
2
+
3
+ client = InferenceClient(
4
+ provider="fireworks-ai",
5
+ api_key="fw_3ZdA78uZG5J5SDvQCVT9qmZA",
6
+ )
7
+
8
+ stream = client.chat.completions.create(
9
+ model="deepseek-ai/DeepSeek-R1",
10
+ messages=[
11
+ {
12
+ "role": "user",
13
+ "content": "What is the capital of France?"
14
+ }
15
+ ],
16
+ stream=True,
17
+ )
18
+
19
+ for chunk in stream:
20
+ print(chunk.choices[0].delta.content, end="")