Ramaravind commited on
Commit
c84d121
·
verified ·
1 Parent(s): 4045387

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from huggingface_hub import InferenceClient
3
+
4
+ client = InferenceClient(
5
+ provider="novita",
6
+ api_key=os.environ["HF_TOKEN"],
7
+ )
8
+
9
+ stream = client.chat.completions.create(
10
+ model="openai/gpt-oss-20b",
11
+ messages=[],
12
+ temperature=0.5,
13
+ top_p=0.7,
14
+ stream=True,
15
+ )
16
+
17
+ for chunk in stream:
18
+ print(chunk.choices[0].delta.content, end="")