Spaces:
Sleeping
Sleeping
Download scratch/test_api_3.py from sardarbipul/hf_models: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/sardarbipul/hf_models/resolve/main/scratch/test_api_3.py
- Command line
-
hf download hf://spaces/sardarbipul/hf_models/scratch/test_api_3.py
-
curl -L -o test_api_3.py https://huggingface.co/spaces/sardarbipul/hf_models/resolve/main/scratch/test_api_3.py
326 Bytes
| import requests | |
| model_id = "meta-llama/Llama-3.3-70B-Instruct" | |
| url = f"https://router.huggingface.co/v1/models/{model_id}" | |
| resp = requests.get(url) | |
| print("Router API Status Code:", resp.status_code) | |
| try: | |
| print("Router JSON:", resp.json()) | |
| except Exception as e: | |
| print("Error:", e) | |
| print("Text:", resp.text[:500]) | |