Spaces:
Running
Running
Download fetch_models.py from victor/pelican-benchmark: direct link, hf CLI and curl.
- Browser
- Download file 377 Bytes
-
https://huggingface.co/spaces/victor/pelican-benchmark/resolve/main/fetch_models.py
- Command line
-
hf download hf://spaces/victor/pelican-benchmark/fetch_models.py
-
curl -L -o fetch_models.py https://huggingface.co/spaces/victor/pelican-benchmark/resolve/main/fetch_models.py
377 Bytes
| import requests | |
| import json | |
| # Fetch available models from Hugging Face router | |
| response = requests.get("https://router.huggingface.co/v1/models") | |
| models = response.json() | |
| print(f"Found {len(models['data'])} models:") | |
| for model in models['data']: | |
| print(f"- {model['id']}") | |
| # Save to file for later use | |
| with open('models.json', 'w') as f: | |
| json.dump(models, f, indent=2) |