import w from "./loadTransformers.js";
async function u(t) {
  const r = `https://huggingface.co/${t}/resolve/main/config.json`, a = `https://huggingface.co/${t}/resolve/main/tokeniser.json`, i = `https://huggingface.co/${t}/resolve/main/meta.json`, c = `https://huggingface.co/${t}/resolve/main/model.safetensors`, [o, e, s, n] = await Promise.all([
    fetch(r),
    fetch(a),
    fetch(i),
    fetch(c)
  ]);
  if (!o.ok)
    throw new Error(`Failed to fetch config from ${r}: ${o.statusText}`);
  if (!e.ok)
    throw new Error(`Failed to fetch tokeniser from ${a}: ${e.statusText}`);
  if (!s.ok)
    throw new Error(`Failed to fetch meta from ${i}: ${s.statusText}`);
  if (!n.ok)
    throw new Error(`Failed to fetch weights from ${c}: ${n.statusText}`);
  const f = await o.json(), g = await e.json(), h = await s.json(), l = await n.arrayBuffer();
  return w(f, g, h, l);
}
export {
  u as default
};
