| // src/services/hf.ts | |
| export async function fetchHFModel(modelId: string) { | |
| const r = await fetch(`https://huggingface.co/api/models/${modelId}`); | |
| if (!r.ok) throw new Error('The model does not exist or cannot be accessed'); | |
| return r.json(); | |
| } | |
| export async function fetchHFDataset(datasetId: string) { | |
| const r = await fetch(`https://huggingface.co/api/datasets/${datasetId}`); | |
| if (!r.ok) throw new Error('The dataset does not exist or cannot be accessed'); | |
| return r.json(); | |
| } | |