Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out why a browser test doesn't work in CI #1286

Closed
coyotte508 opened this issue Mar 14, 2025 · 1 comment
Closed

Figure out why a browser test doesn't work in CI #1286

coyotte508 opened this issue Mar 14, 2025 · 1 comment

Comments

@coyotte508
Copy link
Member

// 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

@coyotte508
Copy link
Member Author

It was different download rates, eg an UInt8Array containing many chunks

Fixed in #1295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant