-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Description
huggingface.js/packages/hub/src/utils/XetBlob.spec.ts
Lines 81 to 108 in f5763f3
// In github actions, this test doesn't work inside the browser, but it works locally | |
// inside both chrome and chromium browsers | |
// TODO: figure out why | |
if (typeof window === "undefined") { | |
it("should load correctly when loading far into a chunk range", async () => { | |
const blob = new XetBlob({ | |
repo: { | |
type: "model", | |
name: "celinah/xet-experiments", | |
}, | |
hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", | |
size: 5_234_139_343, | |
}); | |
const xetDownload = await blob.slice(10_000_000, 10_100_000).arrayBuffer(); | |
const bridgeDownload = await fetch( | |
"https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors", | |
{ | |
headers: { | |
Range: "bytes=10000000-10099999", | |
}, | |
} | |
).then((res) => res.arrayBuffer()); | |
console.log("xet", xetDownload.byteLength, "bridge", bridgeDownload.byteLength); | |
expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload)); | |
}, 30_000); | |
} |
This test doesn't work in the CI.
After publishing , we can at least check it works in browsers (by importing `__internal_XetBlob
Metadata
Metadata
Assignees
Labels
No labels