Spaces:
Sleeping
Sleeping
Download examples/getting_started.py from LVKinyanjui/FastInferenceChat: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/spaces/LVKinyanjui/FastInferenceChat/resolve/main/examples/getting_started.py
- Command line
-
hf download hf://spaces/LVKinyanjui/FastInferenceChat/examples/getting_started.py
-
curl -L -o getting_started.py https://huggingface.co/spaces/LVKinyanjui/FastInferenceChat/resolve/main/examples/getting_started.py
368 Bytes
| import os | |
| from groq import Groq | |
| client = Groq( | |
| api_key=os.environ.get("GROQ_API_KEY"), | |
| ) | |
| chat_completion = client.chat.completions.create( | |
| messages=[ | |
| { | |
| "role": "user", | |
| "content": "Explain the importance of fast language models", | |
| } | |
| ], | |
| model="llama3-8b-8192", | |
| ) | |
| print(chat_completion.choices[0].message.content) |