Download app.py from abhinema/TestApp1: direct link, hf CLI and curl.
- Browser
- Download file 398 Bytes
-
https://huggingface.co/spaces/abhinema/TestApp1/resolve/main/app.py
- Command line
-
hf download hf://spaces/abhinema/TestApp1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/abhinema/TestApp1/resolve/main/app.py
398 Bytes
| import os | |
| from huggingface_hub import InferenceClient | |
| client = InferenceClient( | |
| provider="groq", | |
| api_key=os.environ["HF_TOKEN"], | |
| ) | |
| completion = client.chat.completions.create( | |
| model="meta-llama/Llama-3.3-70B-Instruct", | |
| messages=[ | |
| { | |
| "role": "user", | |
| "content": "What is the capital of France?" | |
| } | |
| ], | |
| ) | |
| print(completion.choices[0].message) |