Spaces:
Paused
Paused
Download hf_workspace/frontend/src/api.js from modventures/iris: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/spaces/modventures/iris/resolve/main/hf_workspace/frontend/src/api.js
- Command line
-
hf download hf://spaces/modventures/iris/hf_workspace/frontend/src/api.js
-
curl -L -o api.js https://huggingface.co/spaces/modventures/iris/resolve/main/hf_workspace/frontend/src/api.js
484 Bytes
| export async function requestAlignment(data) { | |
| const response = await fetch('/api/register', {method: 'POST', body: data}); | |
| const body = await response.json().catch(() => null); | |
| if (!response.ok) { | |
| throw new Error(typeof body?.detail === 'string' ? body.detail : `The request could not be completed (${response.status}). Please retry.`); | |
| } | |
| if (!body?.images || !body?.metrics) throw new Error('The server returned an incomplete review. Please retry.'); | |
| return body; | |
| } | |