Spaces:
Sleeping
Sleeping
Download frontend/src/api/client.js from eunzzang/Deeplearning_Board: direct link, hf CLI and curl.
- Browser
- Download file 775 Bytes
-
https://huggingface.co/spaces/eunzzang/Deeplearning_Board/resolve/main/frontend/src/api/client.js
- Command line
-
hf download hf://spaces/eunzzang/Deeplearning_Board/frontend/src/api/client.js
-
curl -L -o client.js https://huggingface.co/spaces/eunzzang/Deeplearning_Board/resolve/main/frontend/src/api/client.js
775 Bytes
| export async function requestJson(path, options = {}) { | |
| const response = await fetch(path, options); | |
| const contentType = response.headers.get("content-type") || ""; | |
| const data = contentType.includes("application/json") ? await response.json() : null; | |
| if (!response.ok) { | |
| const message = data?.detail?.message || data?.detail || "์์ฒญ์ ์ฒ๋ฆฌํ์ง ๋ชปํ์ต๋๋ค."; | |
| throw new Error(message); | |
| } | |
| return data; | |
| } | |
| export function getConfidenceState(confidence) { | |
| if (confidence >= 0.9) { | |
| return { label: "์์ ", className: "confidence-stable" }; | |
| } | |
| if (confidence >= 0.7) { | |
| return { label: "ํ์ธ ํ์", className: "confidence-review" }; | |
| } | |
| return { label: "๋ค์ ๋ณด๊ธฐ", className: "confidence-retry" }; | |
| } | |