Spaces:
Sleeping
Sleeping
Update testing_pipeline.py
Browse files- testing_pipeline.py +19 -0
testing_pipeline.py
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from huggingface_hub import InferenceClient
|
| 3 |
+
|
| 4 |
+
client = InferenceClient(
|
| 5 |
+
provider="hf-inference",
|
| 6 |
+
api_key=os.environ["HF_TOKEN"],
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
completion = client.chat.completions.create(
|
| 10 |
+
model="sarvamai/sarvam-m",
|
| 11 |
+
messages=[
|
| 12 |
+
{
|
| 13 |
+
"role": "user",
|
| 14 |
+
"content": "What is the capital of France?"
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
print(completion.choices[0].message)
|