Download models.js from VethaNarayananG/MultiModel-AI-Router: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/spaces/VethaNarayananG/MultiModel-AI-Router/resolve/3223afd5f20fbb29dfaf48b1457a2cebc1fe273d/models.js
- Command line
-
hf download hf://spaces/VethaNarayananG/MultiModel-AI-Router@3223afd5f20fbb29dfaf48b1457a2cebc1fe273d/models.js
-
curl -L -o models.js https://huggingface.co/spaces/VethaNarayananG/MultiModel-AI-Router/resolve/3223afd5f20fbb29dfaf48b1457a2cebc1fe273d/models.js
449 Bytes
| async function queryHF(model, prompt){ | |
| const response = await fetch( | |
| `https://api-inference.huggingface.co/models/${model}`, | |
| { | |
| method:"POST", | |
| headers:{ | |
| "Authorization":"Bearer "+HF_TOKEN, | |
| "Content-Type":"application/json" | |
| }, | |
| body:JSON.stringify({ | |
| inputs:prompt | |
| }) | |
| } | |
| ); | |
| return await response.json(); | |
| } |